Make WordPress Core


Ignore:
Timestamp:
11/08/2021 02:26:27 PM (3 years ago)
Author:
youknowriad
Message:

Block Editor: Update the WordPress Packages based on Gutenberg 11.9 RC1.

This brings the JS packages up to date and is the first step that will allow us
to include the other block editor updates for WordPress 5.9:
FSE infrastrucutre, site editor and global styles.

Props noisysocks.
See #54337.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-editor.php

    r51611 r52042  
    188188    }
    189189
     190    // These styles are used if the "no theme styles" options is triggered or on
     191    // themes without their own editor styles.
     192    $default_editor_styles_file = ABSPATH . WPINC . '/css/dist/block-editor/default-editor-styles.css';
     193    if ( file_exists( $default_editor_styles_file ) ) {
     194        $default_editor_styles = array(
     195            array( 'css' => file_get_contents( $default_editor_styles_file ) ),
     196        );
     197    } else {
     198        $default_editor_styles = array();
     199    }
     200
    190201    $editor_settings = array(
    191202        'alignWide'              => get_theme_support( 'align-wide' ),
    192203        'allowedBlockTypes'      => true,
    193204        'allowedMimeTypes'       => get_allowed_mime_types(),
     205        'defaultEditorStyles'    => $default_editor_styles,
    194206        'blockCategories'        => get_default_block_categories(),
    195207        'disableCustomColors'    => get_theme_support( 'disable-custom-colors' ),
     
    465477 * @global array $editor_styles
    466478 *
    467  * @return array An array of theme styles for the block editor. Includes default font family
    468  *               style and theme stylesheets.
     479 * @return array An array of theme styles for the block editor.
    469480 */
    470481function get_block_editor_theme_styles() {
    471482    global $editor_styles;
    472483
    473     if ( ! WP_Theme_JSON_Resolver::theme_has_support() ) {
    474         $styles = array(
    475             array(
    476                 'css'            => 'body { font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif }',
    477                 '__unstableType' => 'core',
    478             ),
    479         );
    480     } else {
    481         $styles = array();
    482     }
     484    $styles = array();
    483485
    484486    if ( $editor_styles && current_theme_supports( 'editor-styles' ) ) {
Note: See TracChangeset for help on using the changeset viewer.