#45059 closed enhancement (fixed)
Changed meaningless variable name "$r"
| Reported by: | freewebmentor | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.3 |
| Component: | General | Version: | 4.9.8 |
| Severity: | minor | Keywords: | good-first-bug has-patch |
| Cc: | Focuses: | coding-standards |
Description
Changed meaningless variable name "$r" from wp-include/category-template.php file and also added the documentation for same.
Attachments (3)
Change History (17)
#1
@
8 years ago
- Focuses coding-standards added; template removed
- Keywords dev-feedback needs-refresh added
- Severity normal → minor
- Summary Changed meaningless variable name "$r" from wp-include/category-template.php file → Changed meaningless variable name "$r"
#2
@
8 years ago
- Keywords needs-patch good-first-bug added; has-patch dev-feedback needs-refresh removed
- Milestone Awaiting Review → Future Release
$r is used so that the original $args array is still available to be passed to various hooks.
Newer code uses $parsed_args for that, see [41733] for example.
So let's change $r to $parsed_args across the older code as well for consistency.
#3
follow-up:
↓ 4
@
8 years ago
@SergeyBiryukov , Thanks for quick review feedback, So I need to update the $r from all the files like wp-includes folder 33 files and wp-admin folder 12 files contain $r variables?
#4
in reply to: ↑ 3
@
8 years ago
Replying to freewebmentor:
So I need to update the $r from all the files like wp-includes folder 33 files and wp-admin folder 12 files contain $r variables?
At a glance, $r is not always used with wp_parse_args() in those files, sometimes it's a shorthand for $result or $response.
In this ticket, I'd suggest focusing on the instances where $r is used with wp_parse_args(). Once that's done, we can create new tickets for other instances.
#6
@
8 years ago
- Milestone Future Release → 5.1
- Owner set to
- Status new → reviewing
Thanks for the patch!
#8
follow-up:
↓ 9
@
8 years ago
- Keywords needs-refresh added
- Milestone 5.1 → 5.2
In 45059.2.patch, I noticed in meta-boxes.php that some of the old references to $r haven't been updated to $parse_args.
Also, this patch has some code formatting issues. It'd be good to run composer run format on it.
#9
in reply to: ↑ 8
@
8 years ago
Thanks @pento,
I will make the suggested changes and will add the updated Patch.
Replying to pento:
In 45059.2.patch, I noticed in
meta-boxes.phpthat some of the old references to$rhaven't been updated to$parse_args.
Also, this patch has some code formatting issues. It'd be good to run
composer run formaton it.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Hi @freewebmentor, Welcome to WordPress Trac! Thank you for your ticket.
We have to change all meaningless variables in core as per coding standards.
Also there are many files which used
$ras array so if we have to change$rvariable then we have to change that variable from all files.For your information WordPress core
wp-includesfolder 33 files andwp-adminfolder 12 files contain$rvariables.