WPSEO_Configuration_Structure

Class WPSEO_Configuration_Structure.

Defined (1)

The class is defined in the following location(s).

/admin/config-ui/class-configuration-structure.php  
  1. class WPSEO_Configuration_Structure { 
  2.  
  3. /** @var array Registered steps */ 
  4. protected $steps = array(); 
  5.  
  6. /** 
  7. * WPSEO_Configuration_Structure constructor. 
  8. */ 
  9. public function __construct() { 
  10.  
  11. $this->add_step( 'intro', __( 'Welcome!', 'wordpress-seo' ), array( 
  12. 'configurationChoices',  
  13. ), false ); 
  14.  
  15. $this->add_step( 'environment_type', __( 'Environment', 'wordpress-seo' ), array( 'environment_type' ) ); 
  16. $this->add_step( 'siteType', __( 'Site type', 'wordpress-seo' ), array( 'siteType' ) ); 
  17. $this->add_step( 'publishingEntity', __( 'Company or person', 'wordpress-seo' ), array( 
  18. 'publishingEntity',  
  19. 'publishingEntityType',  
  20. 'publishingEntityCompanyName',  
  21. 'publishingEntityCompanyLogo',  
  22. 'publishingEntityPersonName',  
  23. ) ); 
  24. $this->add_step( 'profileUrls', __( 'Social profiles', 'wordpress-seo' ), array( 
  25. 'socialProfilesIntro',  
  26. 'profileUrlFacebook',  
  27. 'profileUrlTwitter',  
  28. 'profileUrlInstagram',  
  29. 'profileUrlLinkedIn',  
  30. 'profileUrlMySpace',  
  31. 'profileUrlPinterest',  
  32. 'profileUrlYouTube',  
  33. 'profileUrlGooglePlus',  
  34. ) ); 
  35.  
  36. $fields = array( 'postTypeVisibility' ); 
  37.  
  38. $post_type_factory = new WPSEO_Config_Factory_Post_Type(); 
  39. foreach ( $post_type_factory->get_fields() as $post_type_field ) { 
  40. $fields[] = $post_type_field->get_identifier(); 
  41. $this->add_step( 'postTypeVisibility', __( 'Post type visibility', 'wordpress-seo' ), $fields ); 
  42.  
  43. $this->add_step( 'multipleAuthors', __( 'Multiple authors', 'wordpress-seo' ), array( 'multipleAuthors' ) ); 
  44. $this->add_step( 'connectGoogleSearchConsole', __( 'Google Search Console', 'wordpress-seo' ), array( 'connectGoogleSearchConsole' ) ); 
  45. $this->add_step( 'titleTemplate', __( 'Title settings', 'wordpress-seo' ), array( 
  46. 'siteName',  
  47. 'separator',  
  48. ) ); 
  49. $this->add_step( 'newsletter', __( 'Newsletter' ), array( 
  50. 'mailchimpSignup',  
  51. ) ); 
  52. $this->add_step( 'suggestions', __( 'You might like', 'wordpress-seo' ), array( 
  53. 'suggestions' 
  54. ) ); 
  55. $this->add_step( 'success', __( 'Success!', 'wordpress-seo' ), array( 
  56. 'successMessage',  
  57. ) ); 
  58.  
  59. /** 
  60. * Add a step to the structure 
  61. * @param string $identifier Identifier for this step. 
  62. * @param string $title Title to display for this step. 
  63. * @param array $fields Fields to use on the step. 
  64. * @param bool $navigation Show navigation buttons. 
  65. */ 
  66. protected function add_step( $identifier, $title, $fields, $navigation = true ) { 
  67. $this->steps[ $identifier ] = array( 
  68. 'title' => $title,  
  69. 'fields' => $fields,  
  70. 'hideNavigation' => ! (bool) $navigation,  
  71. ); 
  72.  
  73. /** 
  74. * Retrieve the registered steps 
  75. * @return array 
  76. */ 
  77. public function retrieve() { 
  78. return $this->steps;