display_post_states

過濾鉤子
apply_filters( 'display_post_states', $post_states, $post )
引數
  • (string[]) $post_states An array of post display states.
    Required:
  • (WP_Post) $post The current post object.
    Required:
定義位置
相關勾子
display_site_statesdisplay_media_statessingle_post_titleupdate_post_term_count_statusesupgrader_post_install
相關方法
_post_statesget_post_statesdisplay_plugins_tableregister_post_statusget_post_statusesdisplay_themes
引入
5.5.0
棄用
-

display_post_states: 這個過濾器用來顯示WordPress中的文章的自定義狀態。它通常用於為文章新增自定義標籤或狀態。

過濾在文章列表表中使用的預設文章顯示狀態。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
return apply_filters( 'display_post_states', $post_states, $post );
return apply_filters( 'display_post_states', $post_states, $post );
return apply_filters( 'display_post_states', $post_states, $post );

常見問題

FAQs
檢視更多 >