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.


git-svn-id: https://develop.svn.wordpress.org/trunk@51090 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Riad Benguella
2021-06-08 08:14:59 +00:00
parent 377c88d462
commit 900367bc7a
2 changed files with 12 additions and 5 deletions

View File

@@ -283,10 +283,14 @@ function get_block_editor_settings( array $custom_settings, $block_editor_contex
$theme_json = WP_Theme_JSON_Resolver::get_merged_data( $editor_settings );
if ( WP_Theme_JSON_Resolver::theme_has_support() ) {
$editor_settings['styles'][] = array( 'css' => $theme_json->get_stylesheet( 'block_styles' ) );
$editor_settings['styles'][] = array(
'css' => $theme_json->get_stylesheet( 'block_styles' ),
'__unstableType' => 'globalStyles',
);
$editor_settings['styles'][] = array(
'css' => $theme_json->get_stylesheet( 'css_variables' ),
'__experimentalNoWrapper' => true,
'__unstableType' => 'globalStyles',
);
}