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

    r56571 r56586  
    10201020        // Restores the more descriptive, specific name for use within this method.
    10211021        $post = $item;
     1022
    10221023        $show = current_user_can( 'edit_post', $post->ID );
    10231024
     
    14591460
    14601461        // Restores the more descriptive, specific name for use within this method.
    1461         $post             = $item;
     1462        $post = $item;
     1463
    14621464        $post_type_object = get_post_type_object( $post->post_type );
    14631465        $can_edit_post    = current_user_can( 'edit_post', $post->ID );
Note: See TracChangeset for help on using the changeset viewer.