From 97c1b44bce220d8e7084e4565ed107f3d775e113 Mon Sep 17 00:00:00 2001 From: Jb Audras Date: Wed, 21 Jun 2023 11:49:14 +0000 Subject: [PATCH] Twenty Nineteen: Remove unused function parameters and variables. This changeset removes unused parameters and variables, fixes a typo, and improves some docblocks as per documentation standards. Props upadalavipul, mukesh27, costdev, sabernhardt, hellofromtonya, audrasjb. Fixes #57397. git-svn-id: https://develop.svn.wordpress.org/trunk@55963 602fd350-edb4-49c9-b593-d223f7449a82 --- .../twentynineteen/inc/template-functions.php | 43 ++++++++++++------- 1 file changed, 28 insertions(+), 15 deletions(-) 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. *