summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/modules/masterbar/nudges/additional-css/class-css-nudge-customize-control.php')
-rw-r--r--plugins/jetpack/modules/masterbar/nudges/additional-css/class-css-nudge-customize-control.php56
1 files changed, 56 insertions, 0 deletions
diff --git a/plugins/jetpack/modules/masterbar/nudges/additional-css/class-css-nudge-customize-control.php b/plugins/jetpack/modules/masterbar/nudges/additional-css/class-css-nudge-customize-control.php
new file mode 100644
index 00000000..ad087e12
--- /dev/null
+++ b/plugins/jetpack/modules/masterbar/nudges/additional-css/class-css-nudge-customize-control.php
@@ -0,0 +1,56 @@
+<?php
+/**
+ * CSS_Nudge_Customize_Control file.
+ * CSS Nudge implementation for Atomic and WPCOM.
+ *
+ * @package Jetpack
+ */
+
+namespace Automattic\Jetpack\Dashboard_Customizations;
+
+/**
+ * Class CSS_Nudge_Customize_Control
+ *
+ * @package Automattic\Jetpack\Dashboard_Customizations
+ */
+class CSS_Nudge_Customize_Control extends \WP_Customize_Control {
+
+ /**
+ * The type of the nudge.
+ *
+ * @var string
+ */
+ public $type = 'cssNudge';
+
+ /**
+ * The Call to Action URL.
+ *
+ * @var string
+ */
+ public $cta_url;
+
+ /**
+ * The nudge text displayed.
+ *
+ * @var string
+ */
+ public $nudge_copy;
+
+ /**
+ * Render the nudge on the page.
+ */
+ public function render_content() {
+ $cta_url = $this->cta_url;
+ $nudge_copy = $this->nudge_copy;
+ $nudge_button_copy = __( 'Upgrade Now', 'jetpack' );
+
+ echo '<div class="nudge-container">
+ <p>
+ ' . wp_kses( $nudge_copy, array( 'br' => array() ) ) . '
+ </p>
+ <div class="button-container">
+ <button type="button" class="button-primary navigate-to" data-navigate-to-page="' . esc_url( $cta_url ) . '">' . esc_html( $nudge_button_copy ) . '</button>
+ </div>
+ </div>';
+ }
+}