css
5 years ago
js
5 years ago
class-atomic-additional-css-manager.php
3 years ago
class-css-customizer-nudge.php
5 years ago
class-css-nudge-customize-control.php
5 years ago
class-wpcom-additional-css-manager.php
3 years ago
class-css-nudge-customize-control.php
57 lines
| 1 | <?php |
| 2 | /** |
| 3 | * CSS_Nudge_Customize_Control file. |
| 4 | * CSS Nudge implementation for Atomic and WPCOM. |
| 5 | * |
| 6 | * @package Jetpack |
| 7 | */ |
| 8 | |
| 9 | namespace Automattic\Jetpack\Dashboard_Customizations; |
| 10 | |
| 11 | /** |
| 12 | * Class CSS_Nudge_Customize_Control |
| 13 | * |
| 14 | * @package Automattic\Jetpack\Dashboard_Customizations |
| 15 | */ |
| 16 | class CSS_Nudge_Customize_Control extends \WP_Customize_Control { |
| 17 | |
| 18 | /** |
| 19 | * The type of the nudge. |
| 20 | * |
| 21 | * @var string |
| 22 | */ |
| 23 | public $type = 'cssNudge'; |
| 24 | |
| 25 | /** |
| 26 | * The Call to Action URL. |
| 27 | * |
| 28 | * @var string |
| 29 | */ |
| 30 | public $cta_url; |
| 31 | |
| 32 | /** |
| 33 | * The nudge text displayed. |
| 34 | * |
| 35 | * @var string |
| 36 | */ |
| 37 | public $nudge_copy; |
| 38 | |
| 39 | /** |
| 40 | * Render the nudge on the page. |
| 41 | */ |
| 42 | public function render_content() { |
| 43 | $cta_url = $this->cta_url; |
| 44 | $nudge_copy = $this->nudge_copy; |
| 45 | $nudge_button_copy = __( 'Upgrade Now', 'jetpack' ); |
| 46 | |
| 47 | echo '<div class="nudge-container"> |
| 48 | <p> |
| 49 | ' . wp_kses( $nudge_copy, array( 'br' => array() ) ) . ' |
| 50 | </p> |
| 51 | <div class="button-container"> |
| 52 | <button type="button" class="button-primary navigate-to" data-navigate-to-page="' . esc_url( $cta_url ) . '">' . esc_html( $nudge_button_copy ) . '</button> |
| 53 | </div> |
| 54 | </div>'; |
| 55 | } |
| 56 | } |
| 57 |