WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/08/2021 08:14:59 AM (4 months ago)
Author:
youknowriad
Message:

Block Editor: Add a type property to allow Core to identify the source of the editor styles.

Gutenberg plugin need to override the editor styles provided by core selectively,
this added property allows it to do so without committing to a public API.

Props nosolosw, jorgefilipecosta.
See #53175.

File:
1 edited

Legend:

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

    r51067 r51090  
    284284
    285285    if ( WP_Theme_JSON_Resolver::theme_has_support() ) {
    286         $editor_settings['styles'][] = array( 'css' => $theme_json->get_stylesheet( 'block_styles' ) );
     286        $editor_settings['styles'][] = array(
     287            'css'            => $theme_json->get_stylesheet( 'block_styles' ),
     288            '__unstableType' => 'globalStyles',
     289        );
    287290        $editor_settings['styles'][] = array(
    288291            'css'                     => $theme_json->get_stylesheet( 'css_variables' ),
    289292            '__experimentalNoWrapper' => true,
     293            '__unstableType'          => 'globalStyles',
    290294        );
    291295    }
Note: See TracChangeset for help on using the changeset viewer.