Title: wp_code_editor_settings
Published: November 20, 2017
Last modified: February 24, 2026

---

# apply_filters( ‘wp_code_editor_settings’, array $settings, array $args )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/wp_code_editor_settings/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/hooks/wp_code_editor_settings/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/wp_code_editor_settings/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/wp_code_editor_settings/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/wp_code_editor_settings/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/hooks/wp_code_editor_settings/?output_format=md#wp--skip-link--target)

Filters settings that are passed into the code editor.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/wp_code_editor_settings/?output_format=md#description)󠁿

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

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/wp_code_editor_settings/?output_format=md#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](https://developer.wordpress.org/reference/classes/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.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/wp_code_editor_settings/?output_format=md#source)󠁿

    ```php
    return apply_filters( 'wp_code_editor_settings', $settings, $args );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/general-template.php#L4455)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/general-template.php#L4455-L4455)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/wp_code_editor_settings/?output_format=md#related)󠁿

| Used by | Description | 
| [wp_get_code_editor_settings()](https://developer.wordpress.org/reference/functions/wp_get_code_editor_settings/)`wp-includes/general-template.php` |

Generates and returns code editor settings.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/wp_code_editor_settings/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_code_editor_settings%2F)
before being able to contribute a note or feedback.