wppaste
WordPress

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

Since
4.9.0
Filters settings that are passed into the code editor.

Description

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

Compatibility

WordPress
since 4.9.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$settingsarray
The array of settings passed to the code editor.
A falsey value disables the editor.
$argsarray
{ 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.
}
  • $typestring

    The MIME type of the file to be edited.
  • $filestring

    Filename being edited.
  • $themeWP_Theme

    Theme being edited when on the theme file editor.
  • $pluginstring

    Plugin being edited when on the plugin file editor.
  • $codemirrorarray

    Additional CodeMirror setting overrides.
  • $csslintarray

    CSSLint rule overrides.
  • $jshintarray

    JSHint rule overrides.
  • $htmlhintarray

    HTMLHint rule overrides.

Where this hook fires · 1

  • wp-includes/general-template.php:4455wp_get_code_editor_settings()

Source code

	 *     @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.	 * }	 */	return apply_filters( 'wp_code_editor_settings', $settings, $args );} /** * Retrieves the contents of the search WordPress query variable. * * The search query string is passed through esc_attr() to ensure that it is safe

Changelog

Introduced in 4.9.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.9.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.