diff --git a/src/wp-content/themes/twentynineteen/inc/template-functions.php b/src/wp-content/themes/twentynineteen/inc/template-functions.php index 6c5a96714e..de2fa088bb 100644 --- a/src/wp-content/themes/twentynineteen/inc/template-functions.php +++ b/src/wp-content/themes/twentynineteen/inc/template-functions.php @@ -1,6 +1,6 @@ ` element, empty strings are ignored. + * + * @type string $title Title attribute. + * @type string $target Target attribute. + * @type string $rel The rel attribute. + * @type string $href The href attribute. + * @type string $aria-current The aria-current attribute. + * } + * @param WP_Post $item The current menu item object. + * @return string[] Modified attributes. */ -function twentynineteen_nav_menu_link_attributes( $atts, $item, $args, $depth ) { +function twentynineteen_nav_menu_link_attributes( $atts, $item ) { // Add [aria-haspopup] and [aria-expanded] to menu items that have children. $item_has_children = in_array( 'menu-item-has-children', $item->classes, true ); @@ -174,10 +187,10 @@ function twentynineteen_nav_menu_link_attributes( $atts, $item, $args, $depth ) return $atts; } -add_filter( 'nav_menu_link_attributes', 'twentynineteen_nav_menu_link_attributes', 10, 4 ); +add_filter( 'nav_menu_link_attributes', 'twentynineteen_nav_menu_link_attributes', 10, 2 ); /** - * Create a nav menu item to be displayed on mobile to navigate from submenu back to the parent. + * Creates a nav menu item to be displayed on mobile to navigate from submenu back to the parent. * * This duplicates each parent nav menu item and makes it the first child of itself. *