← All changes
|
jetpack_vendor/automattic/jetpack-masterbar/src/nudges/additional-css/class-wpcom-additional-css-manager.php
+17
-3
13.6.2
→
16.3
View file →
| @@ -35,11 +35,14 @@ | ||
| 35 | 35 | * |
| 36 | 36 | * @param \WP_Customize_Manager $wp_customize_manager The core customize manager. |
| 37 | 37 | */ |
| 38 | 38 | public function register_nudge( \WP_Customize_Manager $wp_customize_manager ) { |
| 39 | - $nudge_url = $this->get_nudge_url(); | |
| 40 | - $nudge_text = __( 'Purchase the Explorer plan to<br> activate CSS customization', 'jetpack-masterbar' ); | |
| 39 | + $plan_name = $this->get_plan()->product_name_short; | |
| 41 | 40 | |
| 41 | + $nudge_url = $this->get_nudge_url(); | |
| 42 | + /* translators: %s is the plan name. */ | |
| 43 | + $nudge_text = sprintf( __( 'Purchase the %s plan to<br> activate CSS customization', 'jetpack-masterbar' ), $plan_name ); | |
| 44 | + | |
| 42 | 45 | $nudge = new CSS_Customizer_Nudge( |
| 43 | 46 | $nudge_url, |
| 44 | 47 | $nudge_text, |
| 45 | 48 | 'jetpack_custom_css' |
| @@ -53,7 +56,18 @@ | ||
| 53 | 56 | * |
| 54 | 57 | * @return string |
| 55 | 58 | */ |
| 56 | 59 | private function get_nudge_url() { |
| 57 | - return '/checkout/' . $this->domain . '/premium'; | |
| 60 | + return '/checkout/' . $this->domain . '/' . $this->get_plan()->path_slug; | |
| 61 | + } | |
| 62 | + | |
| 63 | + /** | |
| 64 | + * Get the plan. | |
| 65 | + * | |
| 66 | + * @return mixed | |
| 67 | + */ | |
| 68 | + protected function get_plan() { | |
| 69 | + $plan_slug = apply_filters( 'wpcom_customize_css_plan_slug', 'value_bundle' ); | |
| 70 | + | |
| 71 | + return \Automattic\Jetpack\Plans::get_plan( $plan_slug ); | |
| 58 | 72 | } |
| 59 | 73 | } |