Uma área de pesquisa sobre o WordPress para devs e autores do tema



wp_add_object_terms ›

Desde3.6.0
Obsoleton/a
wp_add_object_terms ( $object_id, $terms, $taxonomy )
Parâmetros: (3)
  • (int) $object_id The ID of the object to which the terms will be added.
    Required: Yes
  • (string|int|array) $terms The slug(s) or ID(s) of the term(s) to add.
    Required: Yes
  • (array|string) $taxonomy Taxonomy name.
    Required: Yes
Retorna:
  • (array|WP_Error) Term taxonomy IDs of the affected terms.
Definido em:
Codex:

Add term(s) associated with a given object.



Fonte

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