Filter hook 'wp_code_editor_settings'

in WP Core File wp-includes/general-template.php at line 4441

View Source

wp_code_editor_settings

Filter Hook
Description
Filters settings that are passed into the code editor. Returning a falsey value will disable the syntax-highlighting code editor. }

Hook Information

File Location wp-includes/general-template.php View on GitHub
Hook Type Filter
Line Number 4441

Hook Parameters

Type Name Description
array $settings The array of settings passed to the code editor. A falsey value disables the editor.
array $args { Args passed when calling `get_code_editor_settings()`.

Usage Examples

Basic Usage
<?php
// Hook into wp_code_editor_settings
add_filter('wp_code_editor_settings', 'my_custom_filter', 10, 2);

function my_custom_filter($settings, $args) {
    // Your custom filtering logic here
    return $settings;
}

Source Code Context

wp-includes/general-template.php:4441 - How this hook is used in WordPress core
<?php
4436  	 *     @type array    $csslint    CSSLint rule overrides.
4437  	 *     @type array    $jshint     JSHint rule overrides.
4438  	 *     @type array    $htmlhint   HTMLHint rule overrides.
4439  	 * }
4440  	 */
4441  	return apply_filters( 'wp_code_editor_settings', $settings, $args );
4442  }
4443  
4444  /**
4445   * Retrieves the contents of the search WordPress query variable.
4446   *

PHP Documentation

<?php
/**
	 * Filters settings that are passed into the code editor.
	 *
	 * Returning a falsey value will disable the syntax-highlighting code editor.
	 *
	 * @since 4.9.0
	 *
	 * @param array $settings The array of settings passed to the code editor.
	 *                        A falsey value disables the editor.
	 * @param 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.
	 * }
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/general-template.php
Related Hooks

Related hooks will be displayed here in future updates.