Opened 2 years ago
Closed 2 years ago
#56448 closed enhancement (fixed)
Use meaningful variable name for $c in WP_Users_List_Table class
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Users | Keywords: | has-patch |
Focuses: | Cc: |
Description
Currently, the functions get_columns
and get_sortable_columns
in the WP_Users_List_Table
class have a variable $c for the columns. We need to update the names so they will have more meaning.
Change History (14)
This ticket was mentioned in PR #3144 on WordPress/wordpress-develop by burhandodhy.
2 years ago
#1
- Keywords has-patch added
#2
follow-up:
↓ 4
@
2 years ago
- Component changed from General to Users
- Milestone changed from Awaiting Review to 6.1
Thanks for opening the ticket @burhandodhy !
This makes sense. I'd also suggest that we change $r
to $row
in ::single_row()
.
This ticket was mentioned in PR #3146 on WordPress/wordpress-develop by mukeshpanchal27.
2 years ago
#3
Trac ticket:
#4
in reply to:
↑ 2
@
2 years ago
Replying to costdev:
This makes sense. I'd also suggest that we change
$r
to$row
in::single_row()
.
https://github.com/WordPress/wordpress-develop/pull/3146 address $r
to $row
changes. Can you please review the PR?
#5
follow-up:
↓ 6
@
2 years ago
Is this part of a policy?
Because there are much more places using a single character as a variable name in core...
Examples:
$c (blog count) in admin.php
$x (ajax response) in ajax-actions.php
#6
in reply to:
↑ 5
@
2 years ago
Replying to Presskopp:
Is this part of a policy?
I think it falls under this recommendation in Naming Conventions:
Don’t abbreviate variable names unnecessarily; let the code be unambiguous and self-documenting.
There have been some efforts to use more meaningful names for some of the older variables like this as part of general coding standards fixes in tickets like #55647, so I would welcome any further fixes, preferably in separate PRs per file, for easier review.
This ticket was mentioned in PR #3180 on WordPress/wordpress-develop by mukeshpanchal27.
2 years ago
#7
Trac ticket: https://core.trac.wordpress.org/ticket/56448
SergeyBiryukov commented on PR #3144:
2 years ago
#9
Thanks for the PR! Merged in r54070.
SergeyBiryukov commented on PR #3146:
2 years ago
#10
Thanks for the PR! Merged in r54070.
SergeyBiryukov commented on PR #3180:
2 years ago
#12
Thanks for the PR! Merged in r54071.
Trac ticket: https://core.trac.wordpress.org/ticket/56448