class-component-configuration-choices.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <?php
  2. /**
  3. * WPSEO plugin file.
  4. *
  5. * @package WPSEO\Admin\ConfigurationUI
  6. */
  7. /**
  8. * Represents the configuration choices component.
  9. */
  10. class WPSEO_Config_Component_Configuration_Choices implements WPSEO_Config_Component {
  11. /**
  12. * Gets the component identifier.
  13. *
  14. * @return string
  15. */
  16. public function get_identifier() {
  17. return 'ConfigurationChoices';
  18. }
  19. /**
  20. * Gets the field.
  21. *
  22. * @return WPSEO_Config_Field
  23. */
  24. public function get_field() {
  25. $field = new WPSEO_Config_Field_Configuration_Choices();
  26. $field->set_property( 'label', sprintf(
  27. /* translators: %s expands to 'Yoast SEO'. */
  28. __( 'Please choose the %s configuration of your liking:', 'wordpress-seo' ), 'Yoast SEO' )
  29. );
  30. $field->add_choice(
  31. sprintf(
  32. /* translators: %s expands to 'Yoast SEO'. */
  33. __( 'Configure %s in a few steps', 'wordpress-seo' ),
  34. 'Yoast SEO'
  35. ),
  36. sprintf(
  37. /* translators: %1$s expands to 'Yoast SEO'. */
  38. __( 'Welcome to the %1$s configuration wizard. In a few simple steps we\'ll help you configure your SEO settings to match your website\'s needs! %1$s will take care of all the technical optimizations your site needs.', 'wordpress-seo' ),
  39. 'Yoast SEO'
  40. ),
  41. array(
  42. 'type' => 'primary',
  43. 'label' => sprintf(
  44. /* translators: %s expands to 'Yoast SEO'. */
  45. __( 'Configure %s', 'wordpress-seo' ), 'Yoast SEO'
  46. ),
  47. 'action' => 'nextStep',
  48. ),
  49. plugin_dir_url( WPSEO_FILE ) . '/images/Yoast_SEO_Icon.svg'
  50. );
  51. $plugin_training_text = sprintf(
  52. /* translators: %1$s expands to 'Yoast SEO for WordPress', %2$s to Joost de Valk. */
  53. __( 'If you want to take full advantage of the plugin, get our %1$s training. Get insights from renowned SEO expert %2$s and the team behind the plugin. Actionable tips that\'ll help you configure your site to perform even better in search and for your visitors. Hours of video, sliced into bite-sized clips for you to learn from!', 'wordpress-seo' ),
  54. 'Yoast SEO for WordPress',
  55. 'Joost de Valk'
  56. );
  57. $field->add_choice(
  58. sprintf(
  59. /* translators: %s expands to 'Yoast SEO'. */
  60. __( 'Get the most out of the %s plugin', 'wordpress-seo' ), 'Yoast SEO'
  61. ),
  62. $plugin_training_text,
  63. array(
  64. 'type' => 'secondary',
  65. /* translators: %s expands to 'Yoast SEO'. */
  66. 'label' => sprintf( __( 'Get the %s plugin training now', 'wordpress-seo' ), 'Yoast SEO' ),
  67. 'action' => 'followURL',
  68. 'url' => WPSEO_Shortlinker::get( 'https://yoa.st/2vg' ),
  69. ),
  70. plugin_dir_url( WPSEO_FILE ) . 'images/yoast_seo_for_wp_2.svg'
  71. );
  72. return $field;
  73. }
  74. /**
  75. * Get the data for the field.
  76. *
  77. * @return array
  78. */
  79. public function get_data() {
  80. return array();
  81. }
  82. /**
  83. * Save data
  84. *
  85. * @param array $data Data containing changes.
  86. *
  87. * @return bool
  88. */
  89. public function set_data( $data ) {
  90. return true;
  91. }
  92. }