Skip to content

Commit

Permalink
Global Styles on Personal: Added feature check to marketing bar (#40068)
Browse files Browse the repository at this point in the history
* Added a feature check for the GS on Personal plan feature on the marketing bar

* changelog

* Fixed code styles

* Fixed codestyle

* Added missing variable use

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

Upstream-Ref: Automattic/jetpack@c1215ca
  • Loading branch information
rcrdortiz authored and matticbot committed Nov 7, 2024
1 parent 6ca94b3 commit fd55c13
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
This is an alpha version! The changes listed here are not final.

### Added
- 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

Expand Down
10 changes: 8 additions & 2 deletions src/features/wpcom-global-styles/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,13 @@ function wpcom_display_global_styles_launch_bar( $bar_controls ) {
$site_slug = wp_parse_url( $home_url, PHP_URL_HOST );
}

$upgrade_url = "https://wordpress.com/plans/$site_slug?plan=value_bundle&feature=style-customization";
// @TODO Remove this once the global styles are available for all users on the Personal Plan.
$gs_upgrade_plan = WPCOM_VALUE_BUNDLE;
$upgrade_url = "https://wordpress.com/plans/$site_slug?plan=value_bundle&feature=style-customization";
if ( class_exists( 'WPCOM_Feature_Flags' ) && WPCOM_Feature_Flags::is_enabled( WPCOM_Feature_Flags::GLOBAL_STYLES_ON_PERSONAL_PLAN ) ) {
$gs_upgrade_plan = WPCOM_PERSONAL_BUNDLE;
$upgrade_url = "https://wordpress.com/plans/$site_slug?plan=personal-bundle&feature=style-customization";
}

if ( wpcom_is_previewing_global_styles() ) {
$preview_location = add_query_arg( 'hide-global-styles', '' );
Expand Down Expand Up @@ -500,7 +506,7 @@ function wpcom_display_global_styles_launch_bar( $bar_controls ) {
'jetpack-mu-wpcom'
),
$support_url,
get_store_product( WPCOM_VALUE_BUNDLE )->product_name
get_store_product( $gs_upgrade_plan )->product_name
);
printf(
wp_kses(
Expand Down

0 comments on commit fd55c13

Please sign in to comment.