wpseek.com
WordPress开发者和主题制作者的搜索引擎



wp_add_object_terms › WordPress Function

Since3.6.0
已弃用n/a
wp_add_object_terms ( $object_id, $terms, $taxonomy )
参数: (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
返回:
  • (array|WP_Error) Term taxonomy IDs of the affected terms.
定义在:
文档:

Adds term(s) associated with a given object.



源码

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