Title: _WP_Editors::parse_settings
Published: April 25, 2014
Last modified: February 24, 2026

---

# _WP_Editors::parse_settings( string $editor_id, array $settings ): array

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/_WP_Editors/parse_settings/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/_WP_Editors/parse_settings/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/_WP_Editors/parse_settings/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/classes/_WP_Editors/parse_settings/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/classes/_WP_Editors/parse_settings/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/_WP_Editors/parse_settings/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/classes/_WP_Editors/parse_settings/?output_format=md#user-contributed-notes)

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

Parse default arguments for the editor instance.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/_WP_Editors/parse_settings/?output_format=md#parameters)󠁿

 `$editor_id`stringrequired

HTML ID for the textarea and TinyMCE and Quicktags instances.
 Should not contain
square brackets.

`$settings`arrayrequired

Array of editor arguments.

 * `wpautop` bool
 * Whether to use [wpautop()](https://developer.wordpress.org/reference/functions/wpautop/).
   Default true.
 * `media_buttons` bool
 * Whether to show the Add Media/other media buttons.
 * `default_editor` string
 * When both TinyMCE and Quicktags are used, set which editor is shown on page load.
   Default empty.
 * `drag_drop_upload` bool
 * Whether to enable drag & drop on the editor uploading. Default false.
    Requires
   the media modal.
 * `textarea_name` string
 * Give the textarea a unique name here. Square brackets can be used here. Default
   $editor_id.
 * `textarea_rows` int
 * Number rows in the editor textarea. Default 20.
 * `tabindex` string|int
 * Tabindex value to use. Default empty.
 * `tabfocus_elements` string
 * The previous and next element ID to move the focus to when pressing the Tab key
   in TinyMCE. Default `':prev,:next'`.
 * `editor_css` string
 * Intended for extra styles for both Visual and Code editors.
    Should include `
   <style>` tags, and can use "scoped". Default empty.
 * `editor_class` string
 * Extra classes to add to the editor textarea element. Default empty.
 * `teeny` bool
 * Whether to output the minimal editor config. Examples include Press This and 
   the Comment editor. Default false.
 * `dfw` bool
 * Deprecated in 4.1. Unused.
 * `tinymce` bool|array
 * Whether to load TinyMCE. Can be used to pass settings directly to TinyMCE using
   an array. Default true.
 * `quicktags` bool|array
 * Whether to load Quicktags. Can be used to pass settings directly to Quicktags
   using an array. Default true.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/_WP_Editors/parse_settings/?output_format=md#return)󠁿

 array Parsed arguments array.

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

    ```php
    public static function parse_settings( $editor_id, $settings ) {

    	/**
    	 * Filters the wp_editor() settings.
    	 *
    	 * @since 4.0.0
    	 *
    	 * @see _WP_Editors::parse_settings()
    	 *
    	 * @param array  $settings  Array of editor arguments.
    	 * @param string $editor_id Unique editor identifier, e.g. 'content'. Accepts 'classic-block'
    	 *                          when called from block editor's Classic block.
    	 */
    	$settings = apply_filters( 'wp_editor_settings', $settings, $editor_id );

    	$set = wp_parse_args(
    		$settings,
    		array(
    			// Disable autop if the current post has blocks in it.
    			'wpautop'             => ! has_blocks(),
    			'media_buttons'       => true,
    			'default_editor'      => '',
    			'drag_drop_upload'    => false,
    			'textarea_name'       => $editor_id,
    			'textarea_rows'       => 20,
    			'tabindex'            => '',
    			'tabfocus_elements'   => ':prev,:next',
    			'editor_css'          => '',
    			'editor_class'        => '',
    			'teeny'               => false,
    			'_content_editor_dfw' => false,
    			'tinymce'             => true,
    			'quicktags'           => true,
    		)
    	);

    	self::$this_tinymce = ( $set['tinymce'] && user_can_richedit() );

    	if ( self::$this_tinymce ) {
    		if ( str_contains( $editor_id, '[' ) ) {
    			self::$this_tinymce = false;
    			_deprecated_argument( 'wp_editor()', '3.9.0', 'TinyMCE editor IDs cannot have brackets.' );
    		}
    	}

    	self::$this_quicktags = (bool) $set['quicktags'];

    	if ( self::$this_tinymce ) {
    		self::$has_tinymce = true;
    	}

    	if ( self::$this_quicktags ) {
    		self::$has_quicktags = true;
    	}

    	if ( empty( $set['editor_height'] ) ) {
    		return $set;
    	}

    	if ( 'content' === $editor_id && empty( $set['tinymce']['wp_autoresize_on'] ) ) {
    		// A cookie (set when a user resizes the editor) overrides the height.
    		$cookie = (int) get_user_setting( 'ed_size' );

    		if ( $cookie ) {
    			$set['editor_height'] = $cookie;
    		}
    	}

    	if ( $set['editor_height'] < 50 ) {
    		$set['editor_height'] = 50;
    	} elseif ( $set['editor_height'] > 5000 ) {
    		$set['editor_height'] = 5000;
    	}

    	return $set;
    }
    ```

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

## 󠀁[Hooks](https://developer.wordpress.org/reference/classes/_WP_Editors/parse_settings/?output_format=md#hooks)󠁿

 [apply_filters( ‘wp_editor_settings’, array $settings, string $editor_id )](https://developer.wordpress.org/reference/hooks/wp_editor_settings/)

Filters the [wp_editor()](https://developer.wordpress.org/reference/functions/wp_editor/)
settings.

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

| Uses | Description | 
| [has_blocks()](https://developer.wordpress.org/reference/functions/has_blocks/)`wp-includes/blocks.php` |

Determines whether a post or content string has blocks.

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

Determines whether the user can access the visual editor.

  | 
| [get_user_setting()](https://developer.wordpress.org/reference/functions/get_user_setting/)`wp-includes/option.php` |

Retrieves user interface setting value based on setting name.

  | 
| [_deprecated_argument()](https://developer.wordpress.org/reference/functions/_deprecated_argument/)`wp-includes/functions.php` |

Marks a function argument as deprecated and inform when it has been used.

  | 
| [wp_parse_args()](https://developer.wordpress.org/reference/functions/wp_parse_args/)`wp-includes/functions.php` |

Merges user defined arguments into defaults array.

  | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  |

[Show 3 more](https://developer.wordpress.org/reference/classes/_WP_Editors/parse_settings/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/classes/_WP_Editors/parse_settings/?output_format=md#)

| Used by | Description | 
| [wp_tiny_mce()](https://developer.wordpress.org/reference/functions/wp_tiny_mce/)`wp-admin/includes/deprecated.php` |

Outputs the TinyMCE editor.

  | 
| [_WP_Editors::editor()](https://developer.wordpress.org/reference/classes/_wp_editors/editor/)`wp-includes/class-wp-editor.php` |

Outputs the HTML for a single instance of the editor.

  |

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

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

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/classes/_WP_Editors/parse_settings/?output_format=md#user-contributed-notes)󠁿

 1.   [Skip to note 4 content](https://developer.wordpress.org/reference/classes/_WP_Editors/parse_settings/?output_format=md#comment-content-3142)
 2.    [lflier](https://profiles.wordpress.org/lflier/)  [  7 years ago  ](https://developer.wordpress.org/reference/classes/_wp_editors/parse_settings/#comment-3142)
 3.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2F_wp_editors%2Fparse_settings%2F%23comment-3142)
     Vote results for this note: 3[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2F_wp_editors%2Fparse_settings%2F%23comment-3142)
 4.  Suppose, for example, you want to change the stylesheet for the TinyMCE editor.
     You could do it like this:
 5.      ```php
         $settings = array( 
         	'tinymce' => array( 
         		'content_css' => '/wp-content/themes/mytheme/css/tinymce-editor.css',
         	 	), 
         	);
         ```
     
 6.  Other settings for TinyMCE can be found at [https://codex.wordpress.org/TinyMCE](https://codex.wordpress.org/TinyMCE)
 7.   [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2F_wp_editors%2Fparse_settings%2F%3Freplytocom%3D3142%23feedback-editor-3142)
 8.   [Skip to note 5 content](https://developer.wordpress.org/reference/classes/_WP_Editors/parse_settings/?output_format=md#comment-content-5261)
 9.    Anonymous User  [  5 years ago  ](https://developer.wordpress.org/reference/classes/_wp_editors/parse_settings/#comment-5261)
 10. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2F_wp_editors%2Fparse_settings%2F%23comment-5261)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2F_wp_editors%2Fparse_settings%2F%23comment-5261)
 11. **‘dfw’
      (bool) Deprecated in 4.1. Unused.
 12. This is not true.
      `dfw` is the fullscreen mode, used in text mode, when for example
     using the filter `quicktags_settings` it is passed to `$qtInit[‘buttons’]` and
     if you omit, the full screen mode wont show.
 13.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2F_wp_editors%2Fparse_settings%2F%3Freplytocom%3D5261%23feedback-editor-5261)
 14.  [Skip to note 6 content](https://developer.wordpress.org/reference/classes/_WP_Editors/parse_settings/?output_format=md#comment-content-5777)
 15.   [knaveenchand](https://profiles.wordpress.org/knaveenchand/)  [  4 years ago  ](https://developer.wordpress.org/reference/classes/_wp_editors/parse_settings/#comment-5777)
 16. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2F_wp_editors%2Fparse_settings%2F%23comment-5777)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2F_wp_editors%2Fparse_settings%2F%23comment-5777)
 17. To set height of the editor, use ‘editor_height’ settings as shown in this example
     below:
 18.     ```php
         add_filter( 'wp_editor_settings', 'my_wp_editor_settings', 10, 2 );
         function my_wp_editor_settings( $settings, $id ){
             if ( $id == 'content' ){
                 $settings['editor_height'] = 100;        
             }
             return $settings;
         }
         ```
     
 19.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2F_wp_editors%2Fparse_settings%2F%3Freplytocom%3D5777%23feedback-editor-5777)

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