Opened 3 years ago
Closed 3 years ago
#56331 closed enhancement (fixed)
Confusing argument name in `wp_set_post_terms()`
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.1 | Priority: | normal |
| Severity: | normal | Version: | 2.8 |
| Component: | Posts, Post Types | Keywords: | good-first-bug has-patch commit |
| Focuses: | Cc: |
Description
The wp_set_post_terms() function updates the terms for a taxonomy assigned to a given post based on the arguments supplied.
The second argument is $tags. This name makes sense when using the default value of post_tag for the taxonomy argument, but feels weird when any other taxonomy is passed.
At the core, tags are just terms. Changing $tags to $terms would make the function more generic, interchangeable, and less confusing.
Attachments (4)
Change History (14)
#2
@
3 years ago
- Keywords changes-requested added
Hi @hilayt24, thanks for the patch! You'll also need to change all occurrences of $tags inside the function to $terms.
#4
@
3 years ago
Thanks @hilayt24! There's also the "tag delimiter" string, which should be changed to "term delimiter"
#7
@
3 years ago
Thanks for the patch!
The context for _x( ',', 'tag delimiter' ); should not be changed here, as this string is used in other places of core, and changing the context will unnecessarily duplicate it.
@desrosj , I agree with your suggestion here I am adding patch for the same here.