#45059 closed enhancement (fixed)
Changed meaningless variable name "$r"
Reported by: | freewebmentor | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.3 | Priority: | normal |
Severity: | minor | Version: | 4.9.8 |
Component: | General | Keywords: | good-first-bug has-patch |
Focuses: | coding-standards | Cc: |
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
@
6 years ago
- Focuses coding-standards added; template removed
- Keywords dev-feedback needs-refresh added
- Severity changed from normal to minor
- Summary changed from Changed meaningless variable name "$r" from wp-include/category-template.php file to Changed meaningless variable name "$r"
#2
@
6 years ago
- Keywords needs-patch good-first-bug added; has-patch dev-feedback needs-refresh removed
- Milestone changed from Awaiting Review to 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
@
6 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
@
6 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
@
6 years ago
- Milestone changed from Future Release to 5.1
- Owner set to SergeyBiryukov
- Status changed from new to reviewing
Thanks for the patch!
#8
follow-up:
↓ 9
@
6 years ago
- Keywords needs-refresh added
- Milestone changed from 5.1 to 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
@
6 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.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.
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
$r
as array so if we have to change$r
variable then we have to change that variable from all files.For your information WordPress core
wp-includes
folder 33 files andwp-admin
folder 12 files contain$r
variables.