From 7abc752329c2bdd6fe427fee186e829ab69c0280 Mon Sep 17 00:00:00 2001 From: hellofromTonya Date: Thu, 9 Sep 2021 12:39:59 +0000 Subject: [PATCH] Code Modernization: Fix last parameter name mismatches for parent/child classes in `Walker::start_el()`. The parent class uses `$current_object_id` while most of the child classes use `$id`. As the parent class' is more descriptive, renaming the last parameter in each of child class. Why? PHP 8 introduces the ability to pass named arguments to function/method calls. This means the child and parent method signatures (i.e. parameter names) need to match. Changes for readability: - `@since` clearly specifies the original parameter name and its new name as well as why the change happened. - In methods longer than a single line, the generic parameter is reassigned to the original parameter restoring it for context for use within the method. An inline comment is added to explain why this reassignment is made. - In cases where the original parameter name was too generic or misleading, renamed (when reassigning) to a more descriptive name for use within the method. Follow-up to [7737], [8900], [8970], [14248], [15077], [16100], [25642], [25644], [37051], [37054], [37056], [46271], [47189], [51739]. Props jrf, hellofromTonya, sergeybiryukov, azaozz, desrosj, johnbillion. See #51553. Built from https://develop.svn.wordpress.org/trunk@51779 git-svn-id: http://core.svn.wordpress.org/trunk@51386 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../class-walker-category-checklist.php | 15 +++--- .../class-walker-nav-menu-checklist.php | 15 +++--- .../includes/class-walker-nav-menu-edit.php | 27 ++++++----- .../class-twentytwenty-walker-page.php | 30 ++++++------ .../class-walker-category-dropdown.php | 17 +++---- wp-includes/class-walker-category.php | 27 ++++++----- wp-includes/class-walker-comment.php | 15 +++--- wp-includes/class-walker-nav-menu.php | 15 +++--- wp-includes/class-walker-page-dropdown.php | 22 +++++---- wp-includes/class-walker-page.php | 48 ++++++++++--------- wp-includes/class-wp-walker.php | 2 +- wp-includes/version.php | 2 +- 12 files changed, 124 insertions(+), 111 deletions(-) diff --git a/wp-admin/includes/class-walker-category-checklist.php b/wp-admin/includes/class-walker-category-checklist.php index 9e360d62fe..90ee40f834 100644 --- a/wp-admin/includes/class-walker-category-checklist.php +++ b/wp-admin/includes/class-walker-category-checklist.php @@ -61,15 +61,16 @@ class Walker_Category_Checklist extends Walker { * @see Walker::start_el() * * @since 2.5.1 - * @since 5.9.0 Renamed `$category` to `$data_object` to match parent class for PHP 8 named parameter support. + * @since 5.9.0 Renamed `$category` to `$data_object` and `$id` to `$current_object_id` + * to match parent class for PHP 8 named parameter support. * - * @param string $output Used to append additional content (passed by reference). - * @param WP_Term $data_object The current term object. - * @param int $depth Depth of the term in reference to parents. Default 0. - * @param array $args An array of arguments. @see wp_terms_checklist() - * @param int $id ID of the current term. + * @param string $output Used to append additional content (passed by reference). + * @param WP_Term $data_object The current term object. + * @param int $depth Depth of the term in reference to parents. Default 0. + * @param array $args An array of arguments. @see wp_terms_checklist() + * @param int $current_object_id Optional. ID of the current term. Default 0. */ - public function start_el( &$output, $data_object, $depth = 0, $args = array(), $id = 0 ) { + public function start_el( &$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0 ) { // Restores the more descriptive, specific name for use within this method. $category = $data_object; diff --git a/wp-admin/includes/class-walker-nav-menu-checklist.php b/wp-admin/includes/class-walker-nav-menu-checklist.php index e1ff27a59b..939d08b420 100644 --- a/wp-admin/includes/class-walker-nav-menu-checklist.php +++ b/wp-admin/includes/class-walker-nav-menu-checklist.php @@ -61,18 +61,19 @@ class Walker_Nav_Menu_Checklist extends Walker_Nav_Menu { * @see Walker_Nav_Menu::start_el() * * @since 3.0.0 - * @since 5.9.0 Renamed `$item` to `$data_object` to match parent class for PHP 8 named parameter support. + * @since 5.9.0 Renamed `$item` to `$data_object` and `$id` to `$current_object_id` + * to match parent class for PHP 8 named parameter support. * * @global int $_nav_menu_placeholder * @global int|string $nav_menu_selected_id * - * @param string $output Used to append additional content (passed by reference). - * @param WP_Post $data_object Menu item data object. - * @param int $depth Depth of menu item. Used for padding. - * @param stdClass $args Not used. - * @param int $id Not used. + * @param string $output Used to append additional content (passed by reference). + * @param WP_Post $data_object Menu item data object. + * @param int $depth Depth of menu item. Used for padding. + * @param stdClass $args Not used. + * @param int $current_object_id Optional. ID of the current menu item. Default 0. */ - public function start_el( &$output, $data_object, $depth = 0, $args = null, $id = 0 ) { + public function start_el( &$output, $data_object, $depth = 0, $args = null, $current_object_id = 0 ) { global $_nav_menu_placeholder, $nav_menu_selected_id; // Restores the more descriptive, specific name for use within this method. diff --git a/wp-admin/includes/class-walker-nav-menu-edit.php b/wp-admin/includes/class-walker-nav-menu-edit.php index 1b5be7d8c4..f91c086950 100644 --- a/wp-admin/includes/class-walker-nav-menu-edit.php +++ b/wp-admin/includes/class-walker-nav-menu-edit.php @@ -46,17 +46,18 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu { * * @see Walker_Nav_Menu::start_el() * @since 3.0.0 - * @since 5.9.0 Renamed `$item` to `$data_object` to match parent class for PHP 8 named parameter support. + * @since 5.9.0 Renamed `$item` to `$data_object` and `$id` to `$current_object_id` + * to match parent class for PHP 8 named parameter support. * * @global int $_wp_nav_menu_max_depth * - * @param string $output Used to append additional content (passed by reference). - * @param WP_Post $data_object Menu item data object. - * @param int $depth Depth of menu item. Used for padding. - * @param stdClass $args Not used. - * @param int $id Not used. + * @param string $output Used to append additional content (passed by reference). + * @param WP_Post $data_object Menu item data object. + * @param int $depth Depth of menu item. Used for padding. + * @param stdClass $args Not used. + * @param int $current_object_id Optional. ID of the current menu item. Default 0. */ - public function start_el( &$output, $data_object, $depth = 0, $args = null, $id = 0 ) { + public function start_el( &$output, $data_object, $depth = 0, $args = null, $current_object_id = 0 ) { global $_wp_nav_menu_max_depth; // Restores the more descriptive, specific name for use within this method. @@ -241,13 +242,13 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu { * * @since 5.4.0 * - * @param int $item_id Menu item ID. - * @param WP_Post $menu_item Menu item data object. - * @param int $depth Depth of menu item. Used for padding. - * @param stdClass $args An object of menu item arguments. - * @param int $id Nav menu ID. + * @param int $item_id Menu item ID. + * @param WP_Post $menu_item Menu item data object. + * @param int $depth Depth of menu item. Used for padding. + * @param stdClass $args An object of menu item arguments. + * @param int $current_object_id Nav menu ID. */ - do_action( 'wp_nav_menu_item_custom_fields', $item_id, $menu_item, $depth, $args, $id ); + do_action( 'wp_nav_menu_item_custom_fields', $item_id, $menu_item, $depth, $args, $current_object_id ); ?>
diff --git a/wp-content/themes/twentytwenty/classes/class-twentytwenty-walker-page.php b/wp-content/themes/twentytwenty/classes/class-twentytwenty-walker-page.php index 8fe9bae8d8..eb927ec938 100644 --- a/wp-content/themes/twentytwenty/classes/class-twentytwenty-walker-page.php +++ b/wp-content/themes/twentytwenty/classes/class-twentytwenty-walker-page.php @@ -20,19 +20,21 @@ if ( ! class_exists( 'TwentyTwenty_Walker_Page' ) ) { * Outputs the beginning of the current element in the tree. * * @since Twenty Twenty 1.0 - * @since Twenty Twenty 1.9 Renamed `$page` to `$data_object` to match parent class for PHP 8 named parameter support. + * @since Twenty Twenty 1.9 Renamed `$page` to `$data_object` and `$current_page` to `$current_object_id` + * to match parent class for PHP 8 named parameter support. * * @see Walker::start_el() * - * @param string $output Used to append additional content. Passed by reference. - * @param WP_Post $data_object Page data object. - * @param int $depth Optional. Depth of page. Used for padding. Default 0. - * @param array $args Optional. Array of arguments. Default empty array. - * @param int $current_page Optional. Page ID. Default 0. + * @param string $output Used to append additional content. Passed by reference. + * @param WP_Post $data_object Page data object. + * @param int $depth Optional. Depth of page. Used for padding. Default 0. + * @param array $args Optional. Array of arguments. Default empty array. + * @param int $current_object_id Optional. ID of the current page. Default 0. */ - public function start_el( &$output, $data_object, $depth = 0, $args = array(), $current_page = 0 ) { + public function start_el( &$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0 ) { // Restores the more descriptive, specific name for use within this method. - $page = $data_object; + $page = $data_object; + $current_page_id = $current_object_id; if ( isset( $args['item_spacing'] ) && 'preserve' === $args['item_spacing'] ) { $t = "\t"; @@ -53,12 +55,12 @@ if ( ! class_exists( 'TwentyTwenty_Walker_Page' ) ) { $css_class[] = 'page_item_has_children'; } - if ( ! empty( $current_page ) ) { - $_current_page = get_post( $current_page ); + if ( ! empty( $current_page_id ) ) { + $_current_page = get_post( $current_page_id ); if ( $_current_page && in_array( $page->ID, $_current_page->ancestors, true ) ) { $css_class[] = 'current_page_ancestor'; } - if ( $page->ID === $current_page ) { + if ( $page->ID === $current_page_id ) { $css_class[] = 'current_page_item'; } elseif ( $_current_page && $page->ID === $_current_page->post_parent ) { $css_class[] = 'current_page_parent'; @@ -68,7 +70,7 @@ if ( ! class_exists( 'TwentyTwenty_Walker_Page' ) ) { } /** This filter is documented in wp-includes/class-walker-page.php */ - $css_classes = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page ) ); + $css_classes = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page_id ) ); $css_classes = $css_classes ? ' class="' . esc_attr( $css_classes ) . '"' : ''; if ( '' === $page->post_title ) { @@ -81,10 +83,10 @@ if ( ! class_exists( 'TwentyTwenty_Walker_Page' ) ) { $atts = array(); $atts['href'] = get_permalink( $page->ID ); - $atts['aria-current'] = ( $page->ID === $current_page ) ? 'page' : ''; + $atts['aria-current'] = ( $page->ID === $current_page_id ) ? 'page' : ''; /** This filter is documented in wp-includes/class-walker-page.php */ - $atts = apply_filters( 'page_menu_link_attributes', $atts, $page, $depth, $args, $current_page ); + $atts = apply_filters( 'page_menu_link_attributes', $atts, $page, $depth, $args, $current_page_id ); $attributes = ''; foreach ( $atts as $attr => $value ) { diff --git a/wp-includes/class-walker-category-dropdown.php b/wp-includes/class-walker-category-dropdown.php index b8404dd9c6..82b4fedbc5 100644 --- a/wp-includes/class-walker-category-dropdown.php +++ b/wp-includes/class-walker-category-dropdown.php @@ -44,18 +44,19 @@ class Walker_CategoryDropdown extends Walker { * Starts the element output. * * @since 2.1.0 - * @since 5.9.0 Renamed `$category` to `$data_object` to match parent class for PHP 8 named parameter support. + * @since 5.9.0 Renamed `$category` to `$data_object` and `$id` to `$current_object_id` + * to match parent class for PHP 8 named parameter support. * * @see Walker::start_el() * - * @param string $output Used to append additional content (passed by reference). - * @param WP_Term $data_object Category data object. - * @param int $depth Depth of category. Used for padding. - * @param array $args Uses 'selected', 'show_count', and 'value_field' keys, if they exist. - * See wp_dropdown_categories(). - * @param int $id Optional. ID of the current category. Default 0 (unused). + * @param string $output Used to append additional content (passed by reference). + * @param WP_Term $data_object Category data object. + * @param int $depth Depth of category. Used for padding. + * @param array $args Uses 'selected', 'show_count', and 'value_field' keys, if they exist. + * See wp_dropdown_categories(). + * @param int $current_object_id Optional. ID of the current category. Default 0. */ - public function start_el( &$output, $data_object, $depth = 0, $args = array(), $id = 0 ) { + public function start_el( &$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0 ) { // Restores the more descriptive, specific name for use within this method. $category = $data_object; $pad = str_repeat( ' ', $depth * 3 ); diff --git a/wp-includes/class-walker-category.php b/wp-includes/class-walker-category.php index 651bd1310f..43bb7c69cf 100644 --- a/wp-includes/class-walker-category.php +++ b/wp-includes/class-walker-category.php @@ -86,18 +86,19 @@ class Walker_Category extends Walker { * Starts the element output. * * @since 2.1.0 - * @since 5.9.0 Renamed `$category` to `$data_object` to match parent class for PHP 8 named parameter support. + * @since 5.9.0 Renamed `$category` to `$data_object` and `$id` to `$current_object_id` + * to match parent class for PHP 8 named parameter support. * * @see Walker::start_el() * - * @param string $output Used to append additional content (passed by reference). - * @param WP_Term $data_object Category data object. - * @param int $depth Optional. Depth of category in reference to parents. Default 0. - * @param array $args Optional. An array of arguments. See wp_list_categories(). - * Default empty array. - * @param int $id Optional. ID of the current category. Default 0. + * @param string $output Used to append additional content (passed by reference). + * @param WP_Term $data_object Category data object. + * @param int $depth Optional. Depth of category in reference to parents. Default 0. + * @param array $args Optional. An array of arguments. See wp_list_categories(). + * Default empty array. + * @param int $current_object_id Optional. ID of the current category. Default 0. */ - public function start_el( &$output, $data_object, $depth = 0, $args = array(), $id = 0 ) { + public function start_el( &$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0 ) { // Restores the more descriptive, specific name for use within this method. $category = $data_object; @@ -135,12 +136,12 @@ class Walker_Category extends Walker { * @type string $href The href attribute. * @type string $title The title attribute. * } - * @param WP_Term $category Term data object. - * @param int $depth Depth of category, used for padding. - * @param array $args An array of arguments. - * @param int $id ID of the current category. + * @param WP_Term $category Term data object. + * @param int $depth Depth of category, used for padding. + * @param array $args An array of arguments. + * @param int $current_object_id ID of the current category. */ - $atts = apply_filters( 'category_list_link_attributes', $atts, $category, $depth, $args, $id ); + $atts = apply_filters( 'category_list_link_attributes', $atts, $category, $depth, $args, $current_object_id ); $attributes = ''; foreach ( $atts as $attr => $value ) { diff --git a/wp-includes/class-walker-comment.php b/wp-includes/class-walker-comment.php index 4d871ff73d..bf00996028 100644 --- a/wp-includes/class-walker-comment.php +++ b/wp-includes/class-walker-comment.php @@ -157,20 +157,21 @@ class Walker_Comment extends Walker { * Starts the element output. * * @since 2.7.0 - * @since 5.9.0 Renamed `$comment` to `$data_object` to match parent class for PHP 8 named parameter support. + * @since 5.9.0 Renamed `$comment` to `$data_object` and `$id` to `$current_object_id` + * to match parent class for PHP 8 named parameter support. * * @see Walker::start_el() * @see wp_list_comments() * @global int $comment_depth * @global WP_Comment $comment Global comment object. * - * @param string $output Used to append additional content. Passed by reference. - * @param WP_Comment $data_object Comment data object. - * @param int $depth Optional. Depth of the current comment in reference to parents. Default 0. - * @param array $args Optional. An array of arguments. Default empty array. - * @param int $id Optional. ID of the current comment. Default 0 (unused). + * @param string $output Used to append additional content. Passed by reference. + * @param WP_Comment $data_object Comment data object. + * @param int $depth Optional. Depth of the current comment in reference to parents. Default 0. + * @param array $args Optional. An array of arguments. Default empty array. + * @param int $current_object_id Optional. ID of the current comment. Default 0. */ - public function start_el( &$output, $data_object, $depth = 0, $args = array(), $id = 0 ) { + public function start_el( &$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0 ) { // Restores the more descriptive, specific name for use within this method. $comment = $data_object; diff --git a/wp-includes/class-walker-nav-menu.php b/wp-includes/class-walker-nav-menu.php index 9ae4354364..3fdc8d8c4b 100644 --- a/wp-includes/class-walker-nav-menu.php +++ b/wp-includes/class-walker-nav-menu.php @@ -106,17 +106,18 @@ class Walker_Nav_Menu extends Walker { * * @since 3.0.0 * @since 4.4.0 The {@see 'nav_menu_item_args'} filter was added. - * @since 5.9.0 Renamed `$item` to `$data_object` to match parent class for PHP 8 named parameter support. + * @since 5.9.0 Renamed `$item` to `$data_object` and `$id` to `$current_object_id` + * to match parent class for PHP 8 named parameter support. * * @see Walker::start_el() * - * @param string $output Used to append additional content (passed by reference). - * @param WP_Post $data_object Menu item data object. - * @param int $depth Depth of menu item. Used for padding. - * @param stdClass $args An object of wp_nav_menu() arguments. - * @param int $id Current item ID. + * @param string $output Used to append additional content (passed by reference). + * @param WP_Post $data_object Menu item data object. + * @param int $depth Depth of menu item. Used for padding. + * @param stdClass $args An object of wp_nav_menu() arguments. + * @param int $current_object_id Optional. ID of the current menu item. Default 0. */ - public function start_el( &$output, $data_object, $depth = 0, $args = null, $id = 0 ) { + public function start_el( &$output, $data_object, $depth = 0, $args = null, $current_object_id = 0 ) { // Restores the more descriptive, specific name for use within this method. $menu_item = $data_object; diff --git a/wp-includes/class-walker-page-dropdown.php b/wp-includes/class-walker-page-dropdown.php index f391f1ace8..e27ea813bf 100644 --- a/wp-includes/class-walker-page-dropdown.php +++ b/wp-includes/class-walker-page-dropdown.php @@ -44,20 +44,22 @@ class Walker_PageDropdown extends Walker { * Starts the element output. * * @since 2.1.0 - * @since 5.9.0 Renamed `$page` to `$data_object` to match parent class for PHP 8 named parameter support. + * @since 5.9.0 Renamed `$page` to `$data_object` and `$id` to `$current_object_id` + * to match parent class for PHP 8 named parameter support. * * @see Walker::start_el() * - * @param string $output Used to append additional content. Passed by reference. - * @param WP_Post $data_object Page data object. - * @param int $depth Optional. Depth of page in reference to parent pages. Used for padding. - * Default 0. - * @param array $args Optional. Uses 'selected' argument for selected page to set selected HTML - * attribute for option element. Uses 'value_field' argument to fill "value" - * attribute. See wp_dropdown_pages(). Default empty array. - * @param int $id Optional. ID of the current page. Default 0 (unused). + * @param string $output Used to append additional content. Passed by reference. + * @param WP_Post $data_object Page data object. + * @param int $depth Optional. Depth of page in reference to parent pages. + * Used for padding. Default 0. + * @param array $args Optional. Uses 'selected' argument for selected page to + * set selected HTML attribute for option element. Uses + * 'value_field' argument to fill "value" attribute. + * See wp_dropdown_pages(). Default empty array. + * @param int $current_object_id Optional. ID of the current page. Default 0. */ - public function start_el( &$output, $data_object, $depth = 0, $args = array(), $id = 0 ) { + public function start_el( &$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0 ) { // Restores the more descriptive, specific name for use within this method. $page = $data_object; $pad = str_repeat( ' ', $depth * 3 ); diff --git a/wp-includes/class-walker-page.php b/wp-includes/class-walker-page.php index 6eaa147050..daa162d74b 100644 --- a/wp-includes/class-walker-page.php +++ b/wp-includes/class-walker-page.php @@ -93,17 +93,19 @@ class Walker_Page extends Walker { * * @see Walker::start_el() * @since 2.1.0 - * @since 5.9.0 Renamed `$page` to `$data_object` to match parent class for PHP 8 named parameter support. + * @since 5.9.0 Renamed `$page` to `$data_object` and `$current_page` to `$current_object_id` + * to match parent class for PHP 8 named parameter support. * - * @param string $output Used to append additional content. Passed by reference. - * @param WP_Post $data_object Page data object. - * @param int $depth Optional. Depth of page. Used for padding. Default 0. - * @param array $args Optional. Array of arguments. Default empty array. - * @param int $current_page Optional. Page ID. Default 0. + * @param string $output Used to append additional content. Passed by reference. + * @param WP_Post $data_object Page data object. + * @param int $depth Optional. Depth of page. Used for padding. Default 0. + * @param array $args Optional. Array of arguments. Default empty array. + * @param int $current_object_id Optional. ID of the current page. Default 0. */ - public function start_el( &$output, $data_object, $depth = 0, $args = array(), $current_page = 0 ) { + public function start_el( &$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0 ) { // Restores the more descriptive, specific name for use within this method. - $page = $data_object; + $page = $data_object; + $current_page_id = $current_object_id; if ( isset( $args['item_spacing'] ) && 'preserve' === $args['item_spacing'] ) { $t = "\t"; @@ -124,14 +126,14 @@ class Walker_Page extends Walker { $css_class[] = 'page_item_has_children'; } - if ( ! empty( $current_page ) ) { - $_current_page = get_post( $current_page ); + if ( ! empty( $current_page_id ) ) { + $_current_page = get_post( $current_page_id ); if ( $_current_page && in_array( $page->ID, $_current_page->ancestors, true ) ) { $css_class[] = 'current_page_ancestor'; } - if ( $page->ID == $current_page ) { + if ( $page->ID == $current_page_id ) { $css_class[] = 'current_page_item'; } elseif ( $_current_page && $page->ID === $_current_page->post_parent ) { $css_class[] = 'current_page_parent'; @@ -147,13 +149,13 @@ class Walker_Page extends Walker { * * @see wp_list_pages() * - * @param string[] $css_class An array of CSS classes to be applied to each list item. - * @param WP_Post $page Page data object. - * @param int $depth Depth of page, used for padding. - * @param array $args An array of arguments. - * @param int $current_page ID of the current page. + * @param string[] $css_class An array of CSS classes to be applied to each list item. + * @param WP_Post $page Page data object. + * @param int $depth Depth of page, used for padding. + * @param array $args An array of arguments. + * @param int $current_page_id ID of the current page. */ - $css_classes = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page ) ); + $css_classes = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page_id ) ); $css_classes = $css_classes ? ' class="' . esc_attr( $css_classes ) . '"' : ''; if ( '' === $page->post_title ) { @@ -166,7 +168,7 @@ class Walker_Page extends Walker { $atts = array(); $atts['href'] = get_permalink( $page->ID ); - $atts['aria-current'] = ( $page->ID == $current_page ) ? 'page' : ''; + $atts['aria-current'] = ( $page->ID == $current_page_id ) ? 'page' : ''; /** * Filters the HTML attributes applied to a page menu item's anchor element. @@ -179,12 +181,12 @@ class Walker_Page extends Walker { * @type string $href The href attribute. * @type string $aria-current The aria-current attribute. * } - * @param WP_Post $page Page data object. - * @param int $depth Depth of page, used for padding. - * @param array $args An array of arguments. - * @param int $current_page ID of the current page. + * @param WP_Post $page Page data object. + * @param int $depth Depth of page, used for padding. + * @param array $args An array of arguments. + * @param int $current_page_id ID of the current page. */ - $atts = apply_filters( 'page_menu_link_attributes', $atts, $page, $depth, $args, $current_page ); + $atts = apply_filters( 'page_menu_link_attributes', $atts, $page, $depth, $args, $current_page_id ); $attributes = ''; foreach ( $atts as $attr => $value ) { diff --git a/wp-includes/class-wp-walker.php b/wp-includes/class-wp-walker.php index b3c5c6e696..9e39777579 100644 --- a/wp-includes/class-wp-walker.php +++ b/wp-includes/class-wp-walker.php @@ -90,7 +90,7 @@ class Walker { * @param object $data_object The data object. * @param int $depth Depth of the item. * @param array $args An array of additional arguments. - * @param int $current_object_id ID of the current item. + * @param int $current_object_id Optional. ID of the current item. Default 0. */ public function start_el( &$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0 ) {} diff --git a/wp-includes/version.php b/wp-includes/version.php index e858856a24..eafa858ba8 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-alpha-51768'; +$wp_version = '5.9-alpha-51779'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.