wp_code_editor_settings

過濾鉤子
apply_filters( 'wp_code_editor_settings', $settings, $args )
引數
  • (array) $settings The array of settings passed to the code editor. A falsey value disables the editor.
    Required:
  • (array) $args { Args passed when calling `get_code_editor_settings()`. @type string $type The MIME type of the file to be edited. @type string $file Filename being edited. @type WP_Theme $theme Theme being edited when on the theme file editor. @type string $plugin Plugin being edited when on the plugin file editor. @type array $codemirror Additional CodeMirror setting overrides. @type array $csslint CSSLint rule overrides. @type array $jshint JSHint rule overrides. @type array $htmlhint HTMLHint rule overrides. }
    Required:
定義位置
相關勾子
wp_editor_settingsblock_editor_settings_allwp_editor_set_qualitywp_theme_editor_filetypeswp_editor_expand
相關方法
wp_get_code_editor_settingswp_user_settingsget_block_editor_settingsget_default_block_editor_settingswp_color_scheme_settingswp_get_global_settings
引入
4.9.0
棄用
-

wp_code_editor_settings 函式是一個 WordPress 核心函式: 這個函式返回包含程式碼編輯器設定的陣列,包括程式碼編輯器的主題、字型大小、語言等。

過濾傳入程式碼編輯器的設定。

返回一個錯誤的值將禁用語法高亮的程式碼編輯器。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
return apply_filters( 'wp_code_editor_settings', $settings, $args );
return apply_filters( 'wp_code_editor_settings', $settings, $args );
return apply_filters( 'wp_code_editor_settings', $settings, $args );

常見問題

FAQs
檢視更多 >