Source
File: wp-includes/class-wp-editor.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 ( false !== strpos( $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;
}