Keine Beschreibung

class-css-nudge-customize-control.php 1.1KB

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