class-field-profile-url-myspace.php 791 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * WPSEO plugin file.
  4. *
  5. * @package WPSEO\Admin\ConfigurationUI
  6. */
  7. /**
  8. * Class WPSEO_Config_Field_Profile_URL_MySpace
  9. */
  10. class WPSEO_Config_Field_Profile_URL_MySpace extends WPSEO_Config_Field {
  11. /**
  12. * WPSEO_Config_Field_Profile_URL_MySpace constructor.
  13. */
  14. public function __construct() {
  15. parent::__construct( 'profileUrlMySpace', 'Input' );
  16. $this->set_property( 'label', __( 'MySpace URL', 'wordpress-seo' ) );
  17. $this->set_property( 'pattern', '^https:\/\/myspace\.com\/([^/]+)\/$' );
  18. }
  19. /**
  20. * Set adapter
  21. *
  22. * @param WPSEO_Configuration_Options_Adapter $adapter Adapter to register lookup on.
  23. */
  24. public function set_adapter( WPSEO_Configuration_Options_Adapter $adapter ) {
  25. $adapter->add_option_lookup( $this->get_identifier(), 'myspace_url' );
  26. }
  27. }