Make WordPress Core


Ignore:
Timestamp:
09/14/2023 12:44:23 PM (22 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Restore more descriptive variable names in a few class methods.

When various methods parameters in child classes were renamed to $item to match the parent class for PHP 8 named parameter support, most of the methods restored the more descriptive, specific name at the beginning for better readability, with several exceptions for methods consisting only of a few lines.

To avoid confusion about why some methods do that and some don't, this commit aims to bring more consistency to the code, specifically in list tables' ::column_default() methods.

Follow-up to [51728], [51737], [51786].

See #58831.

File:
1 edited

Legend:

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

    r56571 r56586  
    465465
    466466        // Restores the more descriptive, specific name for use within this method.
    467         $tag      = $item;
     467        $tag = $item;
     468
    468469        $taxonomy = $this->screen->taxonomy;
    469470        $uri      = wp_doing_ajax() ? wp_get_referer() : $_SERVER['REQUEST_URI'];
     
    627628     */
    628629    public function column_default( $item, $column_name ) {
     630        // Restores the more descriptive, specific name for use within this method.
     631        $tag = $item;
     632
    629633        /**
    630634         * Filters the displayed columns in the terms list table.
     
    644648         * @param int    $term_id     Term ID.
    645649         */
    646         return apply_filters( "manage_{$this->screen->taxonomy}_custom_column", '', $column_name, $item->term_id );
     650        return apply_filters( "manage_{$this->screen->taxonomy}_custom_column", '', $column_name, $tag->term_id );
    647651    }
    648652
Note: See TracChangeset for help on using the changeset viewer.