update_post_term_count_statuses

過濾鉤子
apply_filters( 'update_post_term_count_statuses', $post_statuses, $taxonomy )
引數
  • (string[]) $post_statuses List of post statuses to include in the count. Default is 'publish'.
    Required:
  • (WP_Taxonomy) $taxonomy Current taxonomy object.
    Required:
定義位置
相關勾子
post_date_column_statuswp_set_comment_statusupdate_postmetaupdated_postmetapost_date_column_time
相關方法
_update_post_term_countupdate_user_statusupdate_posts_countupdate_post_author_cachesupdate_post_parent_cacheswp_update_term_count
引入
5.7.0
棄用
-

update_post_term_count_statuses 是 WordPress 中的過濾器鉤子,它允許開發人員將自定義文章狀態新增到用於更新術語計數資料的文章狀態列表。 此鉤子用於擴充套件 WordPress 術語計數更新過程的功能,允許開發人員在計算中包含自定義文章狀態。

過濾用於更新術語計數的文章狀態。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$post_statuses = esc_sql( apply_filters( 'update_post_term_count_statuses', $post_statuses, $taxonomy ) );
$post_statuses = esc_sql( apply_filters( 'update_post_term_count_statuses', $post_statuses, $taxonomy ) );
$post_statuses = esc_sql( apply_filters( 'update_post_term_count_statuses', $post_statuses, $taxonomy ) );

常見問題

FAQs
檢視更多 >