set_object_terms

动作钩子
do_action( 'set_object_terms', $object_id, $terms, $tt_ids, $taxonomy, $append, $old_tt_ids )
参数
  • (int) $object_id Object ID.
    Required:
  • (array) $terms An array of object term IDs or slugs.
    Required:
  • (array) $tt_ids An array of term taxonomy IDs.
    Required:
  • (string) $taxonomy Taxonomy slug.
    Required:
  • (bool) $append Whether to append new terms to the old terms.
    Required:
  • (array) $old_tt_ids Old array of term taxonomy IDs.
    Required:
定义位置
相关勾子
get_object_termswp_get_object_termswp_get_object_terms_argspre_get_termsclean_object_term_cache
相关方法
wp_set_object_termswp_get_object_termsget_objects_in_termis_object_in_termget_object_term_cachewp_add_object_terms
引入
2.8.0
弃用
-

set_object_terms 是一个WordPress函数,它为一个给定的对象,如一个文章或用户,设置条款: 这个函数用于将术语与一个对象联系起来,例如一个文章的类别或标签。

设置对象的项后触发。

do_action( 'set_object_terms', $object_id, $terms, $tt_ids, $taxonomy, $append, $old_tt_ids );

常见问题

FAQs
查看更多 >