From e093b46b30aba20d742cd5646e994a99d01ebcc3 Mon Sep 17 00:00:00 2001 From: Miguel Date: Thu, 7 Dec 2023 17:01:44 +0700 Subject: [PATCH] Update naming and comments to be more clear --- .../editing-toolkit-plugin/wpcom-global-styles/index.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/editing-toolkit/editing-toolkit-plugin/wpcom-global-styles/index.php b/apps/editing-toolkit/editing-toolkit-plugin/wpcom-global-styles/index.php index fa8c51db8485a0..6b5b0b1c9eaebe 100644 --- a/apps/editing-toolkit/editing-toolkit-plugin/wpcom-global-styles/index.php +++ b/apps/editing-toolkit/editing-toolkit-plugin/wpcom-global-styles/index.php @@ -62,8 +62,9 @@ function wpcom_should_limit_global_styles( $blog_id = 0 ) { return false; } - // Do not limit Global Styles when live previewing a Premium theme with a Premium plan or higher. - if ( wpcom_global_styles_is_previewing_premium_theme_with_premium_plan( $blog_id ) ) { + // Do not limit Global Styles when live previewing a Premium theme without a Premium plan or higher + // because the live preview already shows an upgrade notice, and we avoid duplication. + if ( wpcom_global_styles_is_previewing_premium_theme_without_premium_plan( $blog_id ) ) { return false; } @@ -633,12 +634,12 @@ function wpcom_site_has_global_styles_feature( $blog_id = 0 ) { } /** - * Checks whether the site has access to the Global Styles feature when the editor is live previewing a Premium theme with a Premium plan or higher. + * Checks whether the site has access to the Global Styles feature when the editor is live previewing a Premium theme without a Premium plan or higher. * * @param int $blog_id The WPCOM blog ID. * @return bool Whether the site has access to Global Styles when live previewing. */ -function wpcom_global_styles_is_previewing_premium_theme_with_premium_plan( $blog_id ) { +function wpcom_global_styles_is_previewing_premium_theme_without_premium_plan( $blog_id ) { if ( ! isset( $_GET['wp_theme_preview'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended // Not live previewing. return false;