Make WordPress Core


Ignore:
Timestamp:
09/14/2023 12:44:23 PM (21 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-links-list-table.php

    r56450 r56586  
    291291     */
    292292    public function column_default( $item, $column_name ) {
     293        // Restores the more descriptive, specific name for use within this method.
     294        $link = $item;
     295
    293296        /**
    294297         * Fires for each registered custom link column.
     
    299302         * @param int    $link_id     Link ID.
    300303         */
    301         do_action( 'manage_link_custom_column', $column_name, $item->link_id );
     304        do_action( 'manage_link_custom_column', $column_name, $link->link_id );
    302305    }
    303306
     
    333336
    334337        // Restores the more descriptive, specific name for use within this method.
    335         $link      = $item;
     338        $link = $item;
     339
    336340        $edit_link = get_edit_bookmark_link( $link );
    337341
Note: See TracChangeset for help on using the changeset viewer.