Skip to content

Commit

Permalink
Update naming and comments to be more clear
Browse files Browse the repository at this point in the history
  • Loading branch information
miksansegundo committed Dec 7, 2023
1 parent e7fa6b1 commit e093b46
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit e093b46

Please sign in to comment.