On this page
_WP_Editors::default_settings(): array
This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
Returns the default TinyMCE settings.
Description
Doesn’t include plugins, buttons, editor selector.
Return
array
Source
File: wp-includes/class-wp-editor.php. View all references
private static function default_settings() {
global $tinymce_version;
$shortcut_labels = array();
foreach ( self::get_translation() as $name => $value ) {
if ( is_array( $value ) ) {
$shortcut_labels[ $name ] = $value[1];
}
}
$settings = array(
'theme' => 'modern',
'skin' => 'lightgray',
'language' => self::get_mce_locale(),
'formats' => '{' .
'alignleft: [' .
'{selector: "p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li", styles: {textAlign:"left"}},' .
'{selector: "img,table,dl.wp-caption", classes: "alignleft"}' .
'],' .
'aligncenter: [' .
'{selector: "p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li", styles: {textAlign:"center"}},' .
'{selector: "img,table,dl.wp-caption", classes: "aligncenter"}' .
'],' .
'alignright: [' .
'{selector: "p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li", styles: {textAlign:"right"}},' .
'{selector: "img,table,dl.wp-caption", classes: "alignright"}' .
'],' .
'strikethrough: {inline: "del"}' .
'}',
'relative_urls' => false,
'remove_script_host' => false,
'convert_urls' => false,
'browser_spellcheck' => true,
'fix_list_elements' => true,
'entities' => '38,amp,60,lt,62,gt',
'entity_encoding' => 'raw',
'keep_styles' => false,
'cache_suffix' => 'wp-mce-' . $tinymce_version,
'resize' => 'vertical',
'menubar' => false,
'branding' => false,
// Limit the preview styles in the menu/toolbar.
'preview_styles' => 'font-family font-size font-weight font-style text-decoration text-transform',
'end_container_on_empty_block' => true,
'wpeditimage_html5_captions' => true,
'wp_lang_attr' => get_bloginfo( 'language' ),
'wp_keep_scroll_position' => false,
'wp_shortcut_labels' => wp_json_encode( $shortcut_labels ),
);
$suffix = SCRIPT_DEBUG ? '' : '.min';
$version = 'ver=' . get_bloginfo( 'version' );
// Default stylesheets.
$settings['content_css'] = includes_url( "css/dashicons$suffix.css?$version" ) . ',' .
includes_url( "js/tinymce/skins/wordpress/wp-content.css?$version" );
return $settings;
}
Related
Uses
| Uses | Description |
|---|---|
| _WP_Editors::get_mce_locale() wp-includes/class-wp-editor.php | Returns the TinyMCE locale. |
| _WP_Editors::get_translation() wp-includes/class-wp-editor.php | |
| includes_url() wp-includes/link-template.php | Retrieves the URL to the includes directory. |
| wp_json_encode() wp-includes/functions.php | Encodes a variable into JSON, with some sanity checks. |
| get_bloginfo() wp-includes/general-template.php | Retrieves information about the current site. |
Used By
| Used By | Description |
|---|---|
| _WP_Editors::print_default_editor_scripts() wp-includes/class-wp-editor.php | Print (output) all editor scripts and default settings. |
| _WP_Editors::editor_settings() wp-includes/class-wp-editor.php |
Changelog
| Version | Description |
|---|---|
| 4.8.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/_wp_editors/default_settings