Skip to content

Commit

Permalink
Global Styles on Personal: Update Site Editor Modal and Notice (#40095)
Browse files Browse the repository at this point in the history
* Added plan name and checkout page based on GS on Personal feature flag to the site editor modal

* changelog

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

Upstream-Ref: Automattic/jetpack@39dc704
  • Loading branch information
rcrdortiz authored and matticbot committed Nov 8, 2024
1 parent ca8dd2b commit 416adae
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 87 deletions.
58 changes: 29 additions & 29 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/automattic/jetpack-mu-wpcom/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This is an alpha version! The changes listed here are not final.
- Added a feature check to the Marketing Bar that updates the text and upgrade link for Global Styles
- Enable test coverage.
- Help Center: add new rest route for support interactions
- The notice and modal shown on the editor now displays the plan name and upgrade URL based on the GS gated plan type'

### Changed
- Added feature check for the Global Styles on Personal plan changes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,22 @@ function wpcom_global_styles_enqueue_block_editor_assets() {
if ( class_exists( 'WPCom_Languages' ) ) {
$learn_more_about_styles_post_id = WPCom_Languages::localize_url( $learn_more_about_styles_post_id );
}

// @TODO Remove this once the global styles are available for all users on the Personal Plan.
$upgrade_url = "$calypso_domain/plans/$site_slug?plan=value_bundle&feature=style-customization";
$plan_name = Plans::get_plan( 'value_bundle' )->product_name_short;
if ( class_exists( 'WPCOM_Feature_Flags' ) && WPCOM_Feature_Flags::is_enabled( WPCOM_Feature_Flags::GLOBAL_STYLES_ON_PERSONAL_PLAN ) ) {
$plan_name = Plans::get_plan( 'personal-bundle' )->product_name_short;
$upgrade_url = "$calypso_domain/plans/$site_slug?plan=personal-bundle&feature=style-customization";
}

wp_localize_script(
'wpcom-global-styles-editor',
'wpcomGlobalStyles',
array(
'upgradeUrl' => "$calypso_domain/plans/$site_slug?plan=value_bundle&feature=style-customization",
'upgradeUrl' => $upgrade_url,
'wpcomBlogId' => wpcom_global_styles_get_wpcom_current_blog_id(),
'planName' => Plans::get_plan( 'value_bundle' )->product_name_short,
'planName' => $plan_name,
'modalImage' => plugins_url( 'image.svg', __FILE__ ),
'learnMoreAboutStylesUrl' => $learn_more_about_styles_support_url,
'learnMoreAboutStylesPostId' => $learn_more_about_styles_post_id,
Expand Down
Loading

0 comments on commit 416adae

Please sign in to comment.