[wp-trac] [WordPress Trac] #36690: Improve documentation on deleting all terms associated with an object

WordPress Trac noreply at wordpress.org
Wed Apr 27 15:50:30 UTC 2016


#36690: Improve documentation on deleting all terms associated with an object
-------------------------+-----------------------------
 Reporter:  barryceelen  |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Taxonomy     |    Version:  trunk
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 While looking for a way to delete all terms related to an object I first
 looked at  `wp_remove_object_terms()`. That function however expects the
 slug(s) or ID(s) of the term(s) to remove as a parameter and cannot be
 used for removing all terms at once.

 The right way to do this appears to be passing an empty array or
 null/false for the `$terms` parameter to the `wp_set_object_terms()`
 function.

 It would be helpful to update the documentation of the
 `wp_set_object_terms()` function (or both).

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


More information about the wp-trac mailing list