pre_insert_term

過濾鉤子
apply_filters( 'pre_insert_term', $term, $taxonomy, $args )
引數
  • (string|WP_Error) $term The term name to add, or a WP_Error object if there's an error.
    Required:
  • (string) $taxonomy Taxonomy slug.
    Required:
  • (array|string) $args Array or query string of arguments passed to wp_insert_term().
    Required:
定義位置
相關勾子
pre_get_termsrest_insert_userwp_insert_term_datawp_insert_siterest_pre_insert_user
相關方法
wp_insert_termwp_insert_sitewp_insert_userwp_insert_categorywp_insert_postregister_term_meta
引入
6.1.0
棄用
-

pre_insert_term – 這個鉤子在一個術語插入資料庫之前被呼叫。開發人員可以使用這個鉤子來修改術語資料或阻止術語被完全插入。

在對術語進行淨化並將其插入資料庫之前對其進行過濾。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$term = apply_filters( 'pre_insert_term', $term, $taxonomy, $args );
$term = apply_filters( 'pre_insert_term', $term, $taxonomy, $args );
$term = apply_filters( 'pre_insert_term', $term, $taxonomy, $args );

常見問題

FAQs
檢視更多 >