Skip to content

Commit 8fcaf9f

Browse files
mmtrmatticbot
authored andcommitted
Launchpad: Include "Choose a plan" task in other flows (#30906)
- Includes the "Choose a plan" task in the build, write, and free flows so we can surface whether a paid feature such as Global Styles is in use on a ineligible plan. - The wording of the limited Global Styles notice has been improved. Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/5089003202
1 parent dbb0667 commit 8fcaf9f

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

vendor/automattic/jetpack-mu-wpcom/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This is an alpha version! The changes listed here are not final.
1111

1212
### Added
1313
- Launchpad: Add design-first Launchpad checklist API definition
14+
- Launchpad: Include "Choose a plan" task in other flows
1415
- Remove unnecessary duplicated require of Launchpad plugin.
1516

1617
## [2.2.1] - 2023-05-22

vendor/automattic/jetpack-mu-wpcom/src/features/launchpad/launchpad.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ function wpcom_register_default_launchpad_checklists() {
3434
'title' => __( 'Choose a plan', 'jetpack-mu-wpcom' ),
3535
'subtitle' => 'wpcom_get_plan_selected_subtitle',
3636
'is_complete_callback' => '__return_true',
37+
'badge_text_callback' => 'wpcom_get_plan_selected_badge_text',
3738
)
3839
);
3940

@@ -248,6 +249,7 @@ function wpcom_register_default_launchpad_checklists() {
248249
'task_ids' => array(
249250
'setup_general',
250251
'design_selected',
252+
'plan_selected',
251253
'first_post_published',
252254
'design_edited',
253255
'site_launched',
@@ -260,6 +262,7 @@ function wpcom_register_default_launchpad_checklists() {
260262
'id' => 'free',
261263
'title' => 'Free',
262264
'task_ids' => array(
265+
'plan_selected',
263266
'setup_free',
264267
'design_selected',
265268
'domain_upsell',
@@ -334,6 +337,7 @@ function wpcom_register_default_launchpad_checklists() {
334337
'task_ids' => array(
335338
'setup_write',
336339
'design_selected',
340+
'plan_selected',
337341
'first_post_published',
338342
'site_launched',
339343
),
@@ -489,7 +493,7 @@ function wpcom_get_plan_selected_subtitle() {
489493

490494
return wpcom_global_styles_in_use() && wpcom_should_limit_global_styles()
491495
? __(
492-
'Your site contains custom colors that will only be visible once you upgrade to a Premium plan.',
496+
'Your site contains custom styles. Upgrade now to publish them and unlock tons of other features.',
493497
'jetpack-mu-wpcom'
494498
) : '';
495499
}
@@ -499,6 +503,19 @@ function wpcom_get_plan_selected_subtitle() {
499503
*
500504
* @return string Badge text
501505
*/
506+
function wpcom_get_plan_selected_badge_text() {
507+
if ( ! function_exists( 'wpcom_global_styles_in_use' ) || ! function_exists( 'wpcom_should_limit_global_styles' ) ) {
508+
return '';
509+
}
510+
511+
return wpcom_global_styles_in_use() && wpcom_should_limit_global_styles() ? __( 'Upgrade plan', 'jetpack-mu-wpcom' ) : '';
512+
}
513+
514+
/**
515+
* Returns the badge text for the domain upsell task
516+
*
517+
* @return string Badge text
518+
*/
502519
function wpcom_get_domain_upsell_badge_text() {
503520
// Never run `wpcom_is_checklist_task_complete` within a is_complete_callback unless you are fond of infinite loops.
504521
return wpcom_is_checklist_task_complete( 'domain_upsell' ) ? '' : __( 'Upgrade plan', 'jetpack-mu-wpcom' );

0 commit comments

Comments
 (0)