Skip to content

Commit

Permalink
Global Styles on Personal: Add feature check and sticker to eligible …
Browse files Browse the repository at this point in the history
…blogs (#39986)

* Added a GS check that is enabled for sites when the fGS on Personal plan feature is active

* changelog

* Updated the feature check condition and availability check

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/11705073546

Upstream-Ref: Automattic/jetpack@a312859
  • Loading branch information
rcrdortiz authored and matticbot committed Nov 6, 2024
1 parent 75f1a62 commit da22521
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This is an alpha version! The changes listed here are not final.
- Help Center: add new rest route for support interactions

### Changed
- Added feature check for the Global Styles on Personal plan changes.
- Updated package dependencies.

### Fixed
Expand Down
10 changes: 10 additions & 0 deletions src/features/wpcom-global-styles/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,16 @@ function wpcom_site_has_global_styles_feature( $blog_id = 0 ) {
}
}

// If the GLOBAL_STYLES_ON_PERSONAL_PLAN feature is enabled, we need to check if the site has a Personal plan and add the sticker.
if ( class_exists( 'WPCOM_Feature_Flags' ) && WPCOM_Feature_Flags::is_enabled( 'GLOBAL_STYLES_ON_PERSONAL_PLAN' ) ) {
if ( wpcom_site_has_personal_plan( $blog_id ) ) {
$note = 'Automated sticker. See paYJgx-5w2-p2';
$user = 'a8c'; // A non-empty string avoids storing the current user as author of the sticker change.
add_blog_sticker( 'wpcom-global-styles-personal-plan', $note, $user, $blog_id );
return true;
}
}

return false;
}

Expand Down

0 comments on commit da22521

Please sign in to comment.