Skip to content

Commit

Permalink
Allow access to the Global Styles data in Post Editor
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw committed Jan 11, 2024
1 parent 562a9fa commit 417d97a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/block-editor-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ function gutenberg_get_block_editor_settings( $settings ) {

$settings['styles'] = array_merge( $global_styles, get_block_editor_theme_styles() );

$settings['__experimentalStyles'] = gutenberg_get_global_styles();
$settings['__experimentalFeatures'] = gutenberg_get_global_settings();
// These settings may need to be updated based on data coming from theme.json sources.
if ( isset( $settings['__experimentalFeatures']['color']['palette'] ) ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function get_item_schema() {
'__experimentalStyles' => array(
'description' => __( 'Styles consolidated from core, theme, and user origins.', 'gutenberg' ),
'type' => 'object',
'context' => array( 'mobile' ),
'context' => array( 'post-editor', 'site-editor', 'widgets-editor', 'mobile' ),
),

'__experimentalEnableQuoteBlockV2' => array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const BLOCK_EDITOR_SETTINGS = [
'__experimentalBlockDirectory',
'__experimentalDiscussionSettings',
'__experimentalFeatures',
'__experimentalStyles',
'__experimentalGlobalStylesBaseStyles',
'__experimentalPreferredStyleVariations',
'__unstableGalleryWithImageBlocks',
Expand Down

0 comments on commit 417d97a

Please sign in to comment.