Opened 4 years ago
Closed 4 years ago
#55098 closed enhancement (fixed)
Use meaningful variable name for "$s" and "$tax" in wp_ajax_ajax_tag_search()
| Reported by: | azouamauriac | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.1 |
| Component: | Taxonomy | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | administration, coding-standards |
Description
Change name of followings variables to give them more meaning: $tax, $s.
update documentation too https://developer.wordpress.org/reference/hooks/term_search_min_chars/
Attachments (1)
Change History (5)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Hi there, welcome back to WordPress Trac! Thanks for the ticket.
My initial thought here was that these particular variables seem fine as is:
$taxis used in many more core files as a shorthand for "taxonomy", so renaming it here does not seem to have a significant benefit in terms of consistency.$sis also used in many core files as a reference to a search keyword. This matches the WP_Query parameter and a public query variable of the same name.On second thought, we do have some instances in core where similar variables are called
$taxonomyand$search, respectively, so I guess we can rename these two as well for clarity. Would you like to work on a patch?