Opened 4 years ago
Closed 4 years ago
#56331 closed enhancement (fixed)
Confusing argument name in `wp_set_post_terms()`
| Reported by: | desrosj | Owned by: | desrosj |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.1 |
| Component: | Posts, Post Types | Version: | 2.8 |
| Severity: | normal | Keywords: | good-first-bug has-patch commit |
| Cc: | Focuses: |
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
@
4 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
@
4 years ago
Thanks @hilayt24! There's also the "tag delimiter" string, which should be changed to "term delimiter"
#7
@
4 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
@desrosj , I agree with your suggestion here I am adding patch for the same here.