Core Function
View Source on Trac ↗ wp_add_object_terms()
wp_add_object_terms( mixed $object_id, mixed $terms, mixed $taxonomy ) Adds term(s) associated with a given object.
Parameters 3 required
| Name / Type | Description |
|---|---|
| $object_id int | The ID of the object to which the terms will be added. Required |
| (string | | int | array) $terms The slug(s) or ID(s) of the term(s) to add. Required |
| (array | | string) $taxonomy Taxonomy name. Required |
Return Value
((array)
| WP_Error) Term taxonomy IDs of the affected terms.
Function Information
Since Version
3.6.0
Source File
wp-includes/taxonomy.php
Advertisement