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 Feb 20, 2024
1 parent 3a0f472 commit 085abad
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 @@ -155,7 +155,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 @@ -27,6 +27,7 @@ const BLOCK_EDITOR_SETTINGS = [
'__experimentalBlockDirectory',
'__experimentalDiscussionSettings',
'__experimentalFeatures',
'__experimentalStyles',
'__experimentalGlobalStylesBaseStyles',
'__unstableGalleryWithImageBlocks',
'alignWide',
Expand Down

0 comments on commit 085abad

Please sign in to comment.