Make WordPress Core


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

    r56450 r56586  
    686686
    687687        // Restores the more descriptive, specific name for use within this method.
    688         $comment            = $item;
     688        $comment = $item;
     689
    689690        $the_comment_status = wp_get_comment_status( $comment );
    690691
     
    10881089     */
    10891090    public function column_default( $item, $column_name ) {
     1091        // Restores the more descriptive, specific name for use within this method.
     1092        $comment = $item;
     1093
    10901094        /**
    10911095         * Fires when the default column output is displayed for a single row.
     
    10961100         * @param string $comment_id  The comment ID as a numeric string.
    10971101         */
    1098         do_action( 'manage_comments_custom_column', $column_name, $item->comment_ID );
     1102        do_action( 'manage_comments_custom_column', $column_name, $comment->comment_ID );
    10991103    }
    11001104}
Note: See TracChangeset for help on using the changeset viewer.