Make WordPress Core

Changeset 50069


Ignore:
Timestamp:
01/29/2021 04:57:49 AM (6 years ago)
Author:
noisysocks
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-form-blocks.php

    r49040 r50069  
    186186        array(
    187187                'css' => file_get_contents(
    188                         ABSPATH . WPINC . '/css/dist/editor/editor-styles.css'
     188                        is_rtl()
     189                                ? ABSPATH . WPINC . '/css/dist/editor/editor-styles-rtl.css'
     190                                : ABSPATH . WPINC . '/css/dist/editor/editor-styles.css'
    189191                ),
    190192        ),
    … …  
    218220}
    219221
     222// Default editor styles.
     223$default_editor_styles = array(
     224        array(
     225                'css' => file_get_contents(
     226                        is_rtl()
     227                                ? ABSPATH . WPINC . '/css/dist/editor/editor-styles-rtl.css'
     228                                : ABSPATH . WPINC . '/css/dist/editor/editor-styles.css'
     229                ),
     230        ),
     231);
     232
    220233// Image sizes.
    221234
    … …  
    310323        'allowedMimeTypes'                     => get_allowed_mime_types(),
    311324        'styles'                               => $styles,
     325        'defaultEditorStyles'                  => $default_editor_styles,
    312326        'imageSizes'                           => $available_image_sizes,
    313327        'imageDimensions'                      => $image_dimensions,
Note: See TracChangeset for help on using the changeset viewer.