mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-20 20:44:40 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@56586 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1019,6 +1019,7 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||
public function column_cb( $item ) {
|
||||
// Restores the more descriptive, specific name for use within this method.
|
||||
$post = $item;
|
||||
|
||||
$show = current_user_can( 'edit_post', $post->ID );
|
||||
|
||||
/**
|
||||
@@ -1458,7 +1459,8 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||
}
|
||||
|
||||
// Restores the more descriptive, specific name for use within this method.
|
||||
$post = $item;
|
||||
$post = $item;
|
||||
|
||||
$post_type_object = get_post_type_object( $post->post_type );
|
||||
$can_edit_post = current_user_can( 'edit_post', $post->ID );
|
||||
$actions = array();
|
||||
|
||||
Reference in New Issue
Block a user