[wp-trac] [WordPress Trac] #56331: Confusing argument name in `wp_set_post_terms()`

WordPress Trac noreply at wordpress.org
Thu Aug 4 14:07:47 UTC 2022


#56331: Confusing argument name in `wp_set_post_terms()`
---------------------------------------------+----------------------
 Reporter:  desrosj                          |       Owner:  desrosj
     Type:  enhancement                      |      Status:  closed
 Priority:  normal                           |   Milestone:  6.1
Component:  Posts, Post Types                |     Version:  2.8
 Severity:  normal                           |  Resolution:  fixed
 Keywords:  good-first-bug has-patch commit  |     Focuses:
---------------------------------------------+----------------------
Changes (by desrosj):

 * owner:  (none) => desrosj
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"53825" 53825]:
 {{{
 #!CommitTicketReference repository="" revision="53825"
 Posts, Post Types: Change variable name in `wp_set_post_terms()` for
 clarity.

 This changes the `$tags` variable used within `wp_set_post_terms()` to
 `$terms`.

 While the default for the `$taxonomy` argument is `post_tag`, the function
 can be used to assign terms to a post for any taxonomy. When a different
 taxonomy is passed, `$tags` is an inaccurate name and could be confusing.

 Props hilayt24, costdev, SergeyBiryukov, krishaweb, desrosj.
 Fixes #56331.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56331#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list