You appear to be a bot. Output may be restricted
Description
Add dropdown icon if menu item has children.
Usage
$string = twentyseventeen_dropdown_icon_to_menu_link( $title, $item, $args, $depth );
Parameters
- $title
- ( string ) required – The menu item's title.
- $item
- ( WP_Post ) required – The current menu item.
- $args
- ( stdClass ) required – An object of wp_nav_menu() arguments.
- $depth
- ( int ) required – Depth of menu item. Used for padding.
Returns
string The menu item's title with dropdown icon.
Source
File name: twentyseventeen/inc/icon-functions.php
Lines:
1 to 11 of 11
function twentyseventeen_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 . twentyseventeen_get_svg( array( 'icon' => 'angle-down' ) ); } } } return $title; }