diff --git a/lib/class-wp-rest-block-editor-settings-controller.php b/lib/class-wp-rest-block-editor-settings-controller.php index 70841e152f79e3..398457e4911e54 100644 --- a/lib/class-wp-rest-block-editor-settings-controller.php +++ b/lib/class-wp-rest-block-editor-settings-controller.php @@ -129,9 +129,9 @@ public function get_item_schema() { ), '__experimentalFeatures' => array( - 'description' => __( 'Active theme settings and default values.', 'gutenberg' ), + 'description' => __( 'Settings consolidated from core, theme, and user origins.', 'gutenberg' ), 'type' => 'object', - 'context' => array( 'post-editor', 'site-editor', 'widgets-editor' ), + 'context' => array( 'post-editor', 'site-editor', 'widgets-editor', 'mobile' ), ), '__experimentalGlobalStylesUserEntityId' => array( @@ -146,6 +146,12 @@ public function get_item_schema() { 'context' => array( 'site-editor' ), ), + '__experimentalStyles' => array( + 'description' => __( 'Styles consolidated from core, theme, and user origins.', 'gutenberg' ), + 'type' => 'object', + 'context' => array( 'mobile' ), + ), + 'alignWide' => array( 'description' => __( 'Enable/Disable Wide/Full Alignments.', 'gutenberg' ), 'type' => 'boolean', diff --git a/lib/global-styles.php b/lib/global-styles.php index 77b078351a9eba..8d5552e5e7244c 100644 --- a/lib/global-styles.php +++ b/lib/global-styles.php @@ -88,8 +88,13 @@ function_exists( 'gutenberg_is_edit_site_page' ) && $context = 'site-editor'; } - if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) { - $context = 'rest-request'; + if ( + defined( 'REST_REQUEST' ) && + REST_REQUEST && + isset( $_GET['context'] ) && + 'mobile' === $_GET['context'] + ) { + $context = 'mobile'; } $origin = 'theme'; @@ -102,7 +107,7 @@ function_exists( 'gutenberg_is_edit_site_page' ) && } $consolidated = WP_Theme_JSON_Resolver::get_merged_data( $settings, $origin ); - if ( 'rest-request' === $context ) { + if ( 'mobile' === $context ) { $settings['__experimentalStyles'] = $consolidated->get_raw_data()['styles']; } @@ -116,7 +121,7 @@ function_exists( 'gutenberg_is_edit_site_page' ) && if ( 'site-editor' !== $context && - 'rest-request' !== $context && + 'mobile' !== $context && ( WP_Theme_JSON_Resolver::theme_has_support() || get_theme_support( 'experimental-link-color' ) ) ) { $block_styles = array( 'css' => gutenberg_experimental_global_styles_get_stylesheet( $consolidated, 'block_styles' ) );