diff --git a/wp-admin/includes/class-walker-category-checklist.php b/wp-admin/includes/class-walker-category-checklist.php index 90ee40f834..b86ba23a2b 100644 --- a/wp-admin/includes/class-walker-category-checklist.php +++ b/wp-admin/includes/class-walker-category-checklist.php @@ -125,13 +125,14 @@ class Walker_Category_Checklist extends Walker { * @see Walker::end_el() * * @since 2.5.1 + * @since 5.9.0 Renamed `$category` to `$data_object` to match parent class for PHP 8 named parameter support. * - * @param string $output Used to append additional content (passed by reference). - * @param WP_Term $category 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 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() */ - public function end_el( &$output, $category, $depth = 0, $args = array() ) { + public function end_el( &$output, $data_object, $depth = 0, $args = array() ) { $output .= "\n"; } } diff --git a/wp-includes/class-walker-category.php b/wp-includes/class-walker-category.php index 43bb7c69cf..fcf54a333f 100644 --- a/wp-includes/class-walker-category.php +++ b/wp-includes/class-walker-category.php @@ -254,16 +254,17 @@ class Walker_Category extends Walker { * Ends the element output, if needed. * * @since 2.1.0 + * @since 5.9.0 Renamed `$page` to `$data_object` to match parent class for PHP 8 named parameter support. * * @see Walker::end_el() * - * @param string $output Used to append additional content (passed by reference). - * @param object $page Not used. - * @param int $depth Optional. Depth of category. Not used. - * @param array $args Optional. An array of arguments. Only uses 'list' for whether should append - * to output. See wp_list_categories(). Default empty array. + * @param string $output Used to append additional content (passed by reference). + * @param object $data_object Category data object. Not used. + * @param int $depth Optional. Depth of category. Not used. + * @param array $args Optional. An array of arguments. Only uses 'list' for whether should + * append to output. See wp_list_categories(). Default empty array. */ - public function end_el( &$output, $page, $depth = 0, $args = array() ) { + public function end_el( &$output, $data_object, $depth = 0, $args = array() ) { if ( 'list' !== $args['style'] ) { return; } diff --git a/wp-includes/class-walker-comment.php b/wp-includes/class-walker-comment.php index bf00996028..1a81a0b5d1 100644 --- a/wp-includes/class-walker-comment.php +++ b/wp-includes/class-walker-comment.php @@ -213,19 +213,25 @@ class Walker_Comment extends Walker { * Ends the element output, if needed. * * @since 2.7.0 + * @since 5.9.0 Renamed `$comment` to `$data_object` to match parent class for PHP 8 named parameter support. * * @see Walker::end_el() * @see wp_list_comments() * - * @param string $output Used to append additional content. Passed by reference. - * @param WP_Comment $comment The current comment object. Default current comment. - * @param int $depth Optional. Depth of the current comment. Default 0. - * @param array $args Optional. An array of arguments. Default empty array. + * @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. Default 0. + * @param array $args Optional. An array of arguments. Default empty array. */ - public function end_el( &$output, $comment, $depth = 0, $args = array() ) { + public function end_el( &$output, $data_object, $depth = 0, $args = array() ) { if ( ! empty( $args['end-callback'] ) ) { ob_start(); - call_user_func( $args['end-callback'], $comment, $args, $depth ); + call_user_func( + $args['end-callback'], + $data_object, // The current comment object. + $args, + $depth + ); $output .= ob_get_clean(); return; } diff --git a/wp-includes/class-walker-nav-menu.php b/wp-includes/class-walker-nav-menu.php index 3fdc8d8c4b..fad796005c 100644 --- a/wp-includes/class-walker-nav-menu.php +++ b/wp-includes/class-walker-nav-menu.php @@ -256,15 +256,16 @@ class Walker_Nav_Menu extends Walker { * Ends the element output, if needed. * * @since 3.0.0 + * @since 5.9.0 Renamed `$item` to `$data_object` to match parent class for PHP 8 named parameter support. * * @see Walker::end_el() * - * @param string $output Used to append additional content (passed by reference). - * @param WP_Post $item Page data object. Not used. - * @param int $depth Depth of page. Not Used. - * @param stdClass $args An object of wp_nav_menu() arguments. + * @param string $output Used to append additional content (passed by reference). + * @param WP_Post $data_object Menu item data object. Not used. + * @param int $depth Depth of page. Not Used. + * @param stdClass $args An object of wp_nav_menu() arguments. */ - public function end_el( &$output, $item, $depth = 0, $args = null ) { + public function end_el( &$output, $data_object, $depth = 0, $args = null ) { if ( isset( $args->item_spacing ) && 'discard' === $args->item_spacing ) { $t = ''; $n = ''; diff --git a/wp-includes/class-walker-page.php b/wp-includes/class-walker-page.php index daa162d74b..ad443dc2a6 100644 --- a/wp-includes/class-walker-page.php +++ b/wp-includes/class-walker-page.php @@ -222,15 +222,16 @@ class Walker_Page extends Walker { * Outputs the end of the current element in the tree. * * @since 2.1.0 + * @since 5.9.0 Renamed `$page` to `$data_object` to match parent class for PHP 8 named parameter support. * * @see Walker::end_el() * - * @param string $output Used to append additional content. Passed by reference. - * @param WP_Post $page Page data object. Not used. - * @param int $depth Optional. Depth of page. Default 0 (unused). - * @param array $args Optional. Array of arguments. Default empty array. + * @param string $output Used to append additional content. Passed by reference. + * @param WP_Post $data_object Page data object. Not used. + * @param int $depth Optional. Depth of page. Default 0 (unused). + * @param array $args Optional. Array of arguments. Default empty array. */ - public function end_el( &$output, $page, $depth = 0, $args = array() ) { + public function end_el( &$output, $data_object, $depth = 0, $args = array() ) { if ( isset( $args['item_spacing'] ) && 'preserve' === $args['item_spacing'] ) { $t = "\t"; $n = "\n"; diff --git a/wp-includes/class-wp-walker.php b/wp-includes/class-wp-walker.php index 9e39777579..b50c2d7505 100644 --- a/wp-includes/class-wp-walker.php +++ b/wp-includes/class-wp-walker.php @@ -100,14 +100,15 @@ class Walker { * The $args parameter holds additional values that may be used with the child class methods. * * @since 2.1.0 + * @since 5.9.0 Renamed `$object` (a PHP reserved keyword) to `$data_object` for PHP 8 named parameter support. * @abstract * - * @param string $output Used to append additional content (passed by reference). - * @param object $object The data object. - * @param int $depth Depth of the item. - * @param array $args An array of additional arguments. + * @param string $output Used to append additional content (passed by reference). + * @param object $data_object The data object. + * @param int $depth Depth of the item. + * @param array $args An array of additional arguments. */ - public function end_el( &$output, $object, $depth = 0, $args = array() ) {} + public function end_el( &$output, $data_object, $depth = 0, $args = array() ) {} /** * Traverse elements to create list from elements. diff --git a/wp-includes/version.php b/wp-includes/version.php index eafa858ba8..cf8a23499f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-alpha-51779'; +$wp_version = '5.9-alpha-51780'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.