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

WordPress Trac noreply at wordpress.org
Wed Aug 3 17:10:17 UTC 2022


#56331: Confusing argument name in `wp_set_post_terms()`
-------------------------------+----------------------------
 Reporter:  desrosj            |      Owner:  (none)
     Type:  enhancement        |     Status:  new
 Priority:  normal             |  Milestone:  6.1
Component:  Posts, Post Types  |    Version:  2.8
 Severity:  normal             |   Keywords:  good-first-bug
  Focuses:                     |
-------------------------------+----------------------------
 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.

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


More information about the wp-trac mailing list