Make WordPress Core

Changeset 53174


Ignore:
Timestamp:
04/13/2022 04:12:51 PM (3 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-terms-list-table.php

    r53109 r53174  
    263263     * @param int    $per_page
    264264     * @param int    $count
    265      * @param int    $parent
     265     * @param int    $parent_term
    266266     * @param int    $level
    267267     */
    268     private function _rows( $taxonomy, $terms, &$children, $start, $per_page, &$count, $parent = 0, $level = 0 ) {
     268    private function _rows( $taxonomy, $terms, &$children, $start, $per_page, &$count, $parent_term = 0, $level = 0 ) {
    269269
    270270        $end = $start + $per_page;
     
    276276            }
    277277
    278             if ( $term->parent !== $parent && empty( $_REQUEST['s'] ) ) {
     278            if ( $term->parent !== $parent_term && empty( $_REQUEST['s'] ) ) {
    279279                continue;
    280280            }
Note: See TracChangeset for help on using the changeset viewer.