class-field-upsell-site-review.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * WPSEO plugin file.
  4. *
  5. * @package WPSEO\Admin\ConfigurationUI
  6. */
  7. /**
  8. * Class WPSEO_Config_Field_Upsell_Site_Review.
  9. */
  10. class WPSEO_Config_Field_Upsell_Site_Review extends WPSEO_Config_Field {
  11. /**
  12. * HTML tags allowed in the upsell site review text.
  13. *
  14. * @var array
  15. */
  16. private $allowed_html = [
  17. 'a' => [
  18. 'href' => [],
  19. 'target' => [ '_blank' ],
  20. ],
  21. ];
  22. /**
  23. * WPSEO_Config_Field_Upsell_Site_Review constructor.
  24. */
  25. public function __construct() {
  26. parent::__construct( 'upsellSiteReview', 'HTML' );
  27. $upsell_text = sprintf(
  28. /* translators: %1$s will be a link to a review explanation page. Text between %2$s and %3$s will be a link to an SEO copywriting course page. */
  29. __( 'If you want more help creating awesome content, check out our %2$sSEO copywriting course%3$s. Do you want to know all about the features of the plugin, consider doing our %1$s!', 'wordpress-seo' ),
  30. '<a href="' . WPSEO_Shortlinker::get( 'https://yoa.st/yoastseotraining' ) . '" target="_blank">Yoast SEO for WordPress training</a>',
  31. '<a href="' . WPSEO_Shortlinker::get( 'https://yoa.st/configuration-wizard-copywrite-course-link' ) . '" target="_blank">',
  32. '</a>'
  33. );
  34. $html = '<p>' . wp_kses( $upsell_text, $this->allowed_html ) . '</p>';
  35. $this->set_property( 'html', $html );
  36. }
  37. }