From 5bef9874579e3e963e431ccf84912af28cf1182a Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 13 Apr 2022 16:12:51 +0000 Subject: [PATCH] Code Modernization: Rename parameters that use reserved keywords in `wp-admin/includes/class-wp-terms-list-table.php`. While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names. This commit renames the `$parent` parameter to `$parent_term` in `WP_Terms_List_Table::_rows()`. Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137]. Props jrf, aristath, poena, justinahinon, SergeyBiryukov. See #55327. git-svn-id: https://develop.svn.wordpress.org/trunk@53174 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-terms-list-table.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/includes/class-wp-terms-list-table.php b/src/wp-admin/includes/class-wp-terms-list-table.php index 2ec40f146d..bfda4d7544 100644 --- a/src/wp-admin/includes/class-wp-terms-list-table.php +++ b/src/wp-admin/includes/class-wp-terms-list-table.php @@ -262,10 +262,10 @@ class WP_Terms_List_Table extends WP_List_Table { * @param int $start * @param int $per_page * @param int $count - * @param int $parent + * @param int $parent_term * @param int $level */ - private function _rows( $taxonomy, $terms, &$children, $start, $per_page, &$count, $parent = 0, $level = 0 ) { + private function _rows( $taxonomy, $terms, &$children, $start, $per_page, &$count, $parent_term = 0, $level = 0 ) { $end = $start + $per_page; @@ -275,7 +275,7 @@ class WP_Terms_List_Table extends WP_List_Table { break; } - if ( $term->parent !== $parent && empty( $_REQUEST['s'] ) ) { + if ( $term->parent !== $parent_term && empty( $_REQUEST['s'] ) ) { continue; }