Block Editor: Add defaultEditorStyles

The `defaultEditorStyles` setting was missing from the default block
editor settings. This causes the "Use theme styles" setting which was
added in WordPress 5.6 to not function properly.

Also, the RTL version of editor styles were not being loaded. This
change has not yet been ported over from Gutenberg.

Fixes #52394.

Built from https://develop.svn.wordpress.org/trunk@50069


git-svn-id: http://core.svn.wordpress.org/trunk@49770 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
noisysocks 2021-01-29 04:58:58 +00:00
parent 3dc428f0de
commit 2152259257
2 changed files with 16 additions and 2 deletions

View File

@ -185,7 +185,9 @@ if ( ! $max_upload_size ) {
$styles = array(
array(
'css' => file_get_contents(
ABSPATH . WPINC . '/css/dist/editor/editor-styles.css'
is_rtl()
? ABSPATH . WPINC . '/css/dist/editor/editor-styles-rtl.css'
: ABSPATH . WPINC . '/css/dist/editor/editor-styles.css'
),
),
);
@ -217,6 +219,17 @@ if ( $editor_styles && current_theme_supports( 'editor-styles' ) ) {
}
}
// Default editor styles.
$default_editor_styles = array(
array(
'css' => file_get_contents(
is_rtl()
? ABSPATH . WPINC . '/css/dist/editor/editor-styles-rtl.css'
: ABSPATH . WPINC . '/css/dist/editor/editor-styles.css'
),
),
);
// Image sizes.
/** This filter is documented in wp-admin/includes/media.php */
@ -309,6 +322,7 @@ $editor_settings = array(
'maxUploadFileSize' => $max_upload_size,
'allowedMimeTypes' => get_allowed_mime_types(),
'styles' => $styles,
'defaultEditorStyles' => $default_editor_styles,
'imageSizes' => $available_image_sizes,
'imageDimensions' => $image_dimensions,
'richEditingEnabled' => user_can_richedit(),

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.7-alpha-50068';
$wp_version = '5.7-alpha-50069';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.