WordPress at a glance
function is not described

wp_add_object_terms() WP 3.6.0

Add term(s) associated with a given object.

No Hooks.


Array/WP_Error. Term taxonomy IDs of the affected terms.


wp_add_object_terms( $object_id, $terms, $taxonomy );
$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.


Since 3.6.0 Introduced.

Code of wp_add_object_terms() WP 5.6

function wp_add_object_terms( $object_id, $terms, $taxonomy ) {
	return wp_set_object_terms( $object_id, $terms, $taxonomy, true );