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函式,它為一個給定的物件,如一個文章或使用者,設定條款: 這個函式用於將術語與一個物件聯絡起來,例如一個文章的類別或標籤。

設定物件的項後觸發。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
do_action( 'set_object_terms', $object_id, $terms, $tt_ids, $taxonomy, $append, $old_tt_ids );
do_action( 'set_object_terms', $object_id, $terms, $tt_ids, $taxonomy, $append, $old_tt_ids );
do_action( 'set_object_terms', $object_id, $terms, $tt_ids, $taxonomy, $append, $old_tt_ids );

常見問題

FAQs
檢視更多 >