wp_add_object_terms( int $object_id, string|int|array $terms, array|string $taxonomy )
Add term(s) associated with a given object.
Description Description
Parameters Parameters
- $object_id
-
(int) (Required) The ID of the object to which the terms will be added.
- $terms
-
(string|int|array) (Required) The slug(s) or ID(s) of the term(s) to add.
- $taxonomy
-
(array|string) (Required) Taxonomy name.
Return Return
(array|WP_Error) Term taxonomy IDs of the affected terms.
Source Source
File: wp-includes/taxonomy.php
function wp_add_object_terms( $object_id, $terms, $taxonomy ) { return wp_set_object_terms( $object_id, $terms, $taxonomy, true ); }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
3.6.0 | Introduced. |
User Contributed Notes User Contributed Notes
You must log in before being able to contribute a note or feedback.
Set categories for an attachment