wp_add_object_terms

Advertisement

Summery Summery

Add term(s) associated with a given object.

Syntax Syntax

wp_add_object_terms( int $object_id, string|int|array $terms, array|string $taxonomy )

Parameters Parameters

$object_id

(Required) The ID of the object to which the terms will be added.

$terms

(Required) The slug(s) or ID(s) of the term(s) to add.

$taxonomy

(Required) Taxonomy name.

Return Return

(array|WP_Error) Term taxonomy IDs of the affected terms.

Source Source

File: wp-includes/taxonomy.php

		do_action( 'add_term_relationship', $object_id, $tt_id, $taxonomy );

		$wpdb->insert(

Advertisement

Changelog Changelog

Changelog
Version Description
3.6.0 Introduced.

Advertisement

Leave a Reply