wp_code_editor_settings WordPress Filter Hook

The wp_code_editor_settings hook is used to modify the settings for the WordPress code editor. This hook is useful for plugin and theme developers who want to add their own customizations to the editor.

apply_filters( 'wp_code_editor_settings', array $settings, array $args ) #

Filters settings that are passed into the code editor.


Description

Returning a falsey value will disable the syntax-highlighting code editor.


Top ↑

Parameters

$settings

(array)The array of settings passed to the code editor. A falsey value disables the editor.

$args

(array)Args passed when calling get_code_editor_settings().

  • 'type'
    (string) The MIME type of the file to be edited.
  • 'file'
    (string) Filename being edited.
  • 'theme'
    (WP_Theme) Theme being edited when on the theme file editor.
  • 'plugin'
    (string) Plugin being edited when on the plugin file editor.
  • 'codemirror'
    (array) Additional CodeMirror setting overrides.
  • 'csslint'
    (array) CSSLint rule overrides.
  • 'jshint'
    (array) JSHint rule overrides.
  • 'htmlhint'
    (array) HTMLHint rule overrides.


Top ↑

Source

File: wp-includes/general-template.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More