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-ms-sites-list-table.php

    r56450 r56586  
    598598     */
    599599    public function column_default( $item, $column_name ) {
     600        // Restores the more descriptive, specific name for use within this method.
     601        $blog = $item;
     602
    600603        /**
    601604         * Fires for each registered custom column in the Sites list table.
     
    606609         * @param int    $blog_id     The site ID.
    607610         */
    608         do_action( 'manage_sites_custom_column', $column_name, $item['blog_id'] );
     611        do_action( 'manage_sites_custom_column', $column_name, $blog['blog_id'] );
    609612    }
    610613
     
    715718
    716719        // Restores the more descriptive, specific name for use within this method.
    717         $blog     = $item;
     720        $blog = $item;
     721
    718722        $blogname = untrailingslashit( $blog['domain'] . $blog['path'] );
    719723
Note: See TracChangeset for help on using the changeset viewer.