wp_editor_expand

過濾鉤子
apply_filters( 'wp_editor_expand', true, $post_type )
引數
  • (bool) $expand Whether to enable the 'expand' functionality. Default true.
    Required:
  • (string) $post_type Post type.
    Required:
定義位置
相關勾子
wp_editor_settingswp_editor_set_qualitywp_code_editor_settingswp_error_addedwp_redirect
相關方法
wp_editorwp_mkdir_pwp_randwp_import_cleanupwp_embed_register_handlerwp_print_editor_js
引入
4.1.0
棄用
-

wp_editor_expand是 WordPress 中的過濾器鉤子,它允許開發人員控制是否應擴充套件或收縮文章編輯螢幕中的視覺化編輯器。預設情況下,視覺化編輯器是收縮的,過濾器鉤子允許開發人員通過返回true以展開編輯器或false保持收縮來更改此行為。

過濾是否在文章編輯器中啟用”擴充套件” 功能。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
if ( apply_filters( 'wp_editor_expand', true, $post_type ) ) {
if ( apply_filters( 'wp_editor_expand', true, $post_type ) ) {
if ( apply_filters( 'wp_editor_expand', true, $post_type ) ) {

常見問題

FAQs
檢視更多 >