From 298f50847b315e7dca622c8d2cacd0628ee7cc67 Mon Sep 17 00:00:00 2001 From: Gerardo Pacheco Date: Thu, 20 May 2021 10:05:36 +0200 Subject: [PATCH] Fix condition for global styles on mobile (#31844) * Fix condition for global styles on mobile * Set mobile context if theme has support --- lib/global-styles.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/global-styles.php b/lib/global-styles.php index 8d5552e5e7244..331649d5ba5a7 100644 --- a/lib/global-styles.php +++ b/lib/global-styles.php @@ -92,7 +92,8 @@ function_exists( 'gutenberg_is_edit_site_page' ) && defined( 'REST_REQUEST' ) && REST_REQUEST && isset( $_GET['context'] ) && - 'mobile' === $_GET['context'] + 'mobile' === $_GET['context'] && + WP_Theme_JSON_Resolver::theme_has_support() ) { $context = 'mobile'; }