/wp-content/plugins/wordpress-seo/admin/config-ui/components/class-component-configuration-choices.php

https://bitbucket.org/carloskikea/helpet · PHP · 98 lines · 54 code · 8 blank · 36 comment · 0 complexity · 70555997c12a379fc36c2bab1842cb0a MD5 · raw file

  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. $field->add_choice(
  52. sprintf(
  53. /* translators: %s expands to 'Yoast SEO'. */
  54. __( 'Let us set up %s for you', 'wordpress-seo' ), 'Yoast SEO'
  55. ),
  56. sprintf(
  57. /* translators: %1$s expands to 'Yoast SEO', %2$s expands to 'Yoast SEO Premium'. */
  58. __( 'While we strive to make setting up %1$s as easy as possible, we understand it can still be daunting. If you would rather have us set up %1$s for you (and get a copy of %2$s in the process), order a %1$s configuration service and sit back while we configure your site.', 'wordpress-seo' ),
  59. 'Yoast SEO',
  60. 'Yoast SEO Premium'
  61. ),
  62. array(
  63. 'type' => 'secondary',
  64. 'label' => __( 'Configuration service', 'wordpress-seo' ),
  65. 'action' => 'followURL',
  66. 'url' => WPSEO_Shortlinker::get( 'https://yoa.st/wizard-configuration-upsell' ),
  67. ),
  68. plugin_dir_url( WPSEO_FILE ) . 'images/yoast-configuration-icon.svg'
  69. );
  70. return $field;
  71. }
  72. /**
  73. * Get the data for the field.
  74. *
  75. * @return array
  76. */
  77. public function get_data() {
  78. return array();
  79. }
  80. /**
  81. * Save data
  82. *
  83. * @param array $data Data containing changes.
  84. *
  85. * @return bool
  86. */
  87. public function set_data( $data ) {
  88. return true;
  89. }
  90. }