Opened 3 years ago
Closed 2 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 |
---|---|---|---|
Milestone: | 6.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Taxonomy | Keywords: | has-patch |
Focuses: | administration, coding-standards | Cc: |
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.
Hi there, welcome back to WordPress Trac! Thanks for the ticket.
My initial thought here was that these particular variables seem fine as is:
$tax
is 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.$s
is 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
$taxonomy
and$search
, respectively, so I guess we can rename these two as well for clarity. Would you like to work on a patch?