Improve documentation on deleting all terms associated with an object
|Reported by:||barryceelen||Owned by:||SergeyBiryukov|
|Component:||Taxonomy||Keywords:||has-patch 2nd-opinion good-first-bug|
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).
Change History (10)
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed