/wp-content/plugins/wordpress-seo/admin/config-ui/fields/class-field-site-type.php

https://bitbucket.org/carloskikea/helpet · PHP · 39 lines · 17 code · 5 blank · 17 comment · 0 complexity · 0bc3d692eab8109435a83db7cd7c924e MD5 · raw file

  1. <?php
  2. /**
  3. * WPSEO plugin file.
  4. *
  5. * @package WPSEO\Admin\ConfigurationUI
  6. */
  7. /**
  8. * Class WPSEO_Config_Field_Site_Type
  9. */
  10. class WPSEO_Config_Field_Site_Type extends WPSEO_Config_Field_Choice {
  11. /**
  12. * WPSEO_Config_Field_Site_Type constructor.
  13. */
  14. public function __construct() {
  15. parent::__construct( 'siteType' );
  16. /* translators: %1$s resolves to the home_url of the blog. */
  17. $this->set_property( 'label', sprintf( __( 'What does the site %1$s represent?', 'wordpress-seo' ), get_home_url() ) );
  18. $this->add_choice( 'blog', __( 'A blog', 'wordpress-seo' ) );
  19. $this->add_choice( 'shop', __( 'An online shop', 'wordpress-seo' ) );
  20. $this->add_choice( 'news', __( 'A news channel', 'wordpress-seo' ) );
  21. $this->add_choice( 'smallBusiness', __( 'A small offline business', 'wordpress-seo' ) );
  22. $this->add_choice( 'corporate', __( 'A corporation', 'wordpress-seo' ) );
  23. $this->add_choice( 'portfolio', __( 'A portfolio', 'wordpress-seo' ) );
  24. $this->add_choice( 'other', __( 'Something else', 'wordpress-seo' ) );
  25. }
  26. /**
  27. * Set adapter
  28. *
  29. * @param WPSEO_Configuration_Options_Adapter $adapter Adapter to register lookup on.
  30. */
  31. public function set_adapter( WPSEO_Configuration_Options_Adapter $adapter ) {
  32. $adapter->add_option_lookup( $this->get_identifier(), 'site_type' );
  33. }
  34. }