'', 'title' => '', 'desc' => '', 'fallback' => false, ); // Parse args. $args = wp_parse_args( $args, $defaults ); // Set aria hidden. $aria_hidden = ' aria-hidden="true"'; // Set ARIA. $aria_labelledby = ''; /* * Example 1 with title: 'arrow-right', 'title' => __( 'This is the title', 'textdomain' ) ) ); ?> * * Example 2 with title and description: 'arrow-right', 'title' => __( 'This is the title', 'textdomain' ), 'desc' => __( 'This is the description', 'textdomain' ) ) ); ?> * fos not contains titles, title tag removed */ // Begin fontawesome markup. $fos = ''; /* * Display the icon. * * The whitespace around `` is intentional - it is a work around to a keyboard navigation bug in Safari 10. * * See https://core.trac.wordpress.org/ticket/38387. */ $fos .= ' '; // Add some markup to use as a fallback for browsers that do not support SVGs. if ( $args['fallback'] ) { $fos .= ''; } $fos .= ''; return $fos; } /** * Add dropdown icon if menu item has children. * * @param string $title The menu item's title. * @param WP_Post $item The current menu item. * @param array $args An array of wp_nav_menu() arguments. * @param int $depth Depth of menu item. Used for padding. * @return string $title The menu item's title with dropdown icon. */ function the_business_wp_dropdown_icon_to_menu_link( $title, $item, $args, $depth ) { if ( 'top' === $args->theme_location ) { foreach ( $item->classes as $value ) { if ( 'menu-item-has-children' === $value || 'page_item_has_children' === $value ) { $title = $title . the_business_wp_get_fo( array( 'icon' => 'angle-down' ) ); } } } return $title; } add_filter( 'nav_menu_item_title', 'the_business_wp_dropdown_icon_to_menu_link', 10, 4 );