forked from Yoast/wordpress-seo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclass-configuration-structure.php
98 lines (89 loc) · 2.99 KB
/
class-configuration-structure.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
/**
* @package WPSEO\Admin\ConfigurationUI
*/
/**
* Class WPSEO_Configuration_Structure
*/
class WPSEO_Configuration_Structure {
/** @var array Registered steps */
protected $steps = array();
/**
* WPSEO_Configuration_Structure constructor.
*/
public function initialize() {
$this->add_step( 'intro', __( 'Welcome!', 'wordpress-seo' ), array(
'configurationChoices',
), false, true );
$this->add_step( 'environment_type', __( 'Environment', 'wordpress-seo' ), array( 'environment_type' ) );
$this->add_step( 'siteType', __( 'Site type', 'wordpress-seo' ), array( 'siteType' ) );
$this->add_step( 'publishingEntity', __( 'Company or person', 'wordpress-seo' ), array(
'publishingEntity',
'publishingEntityType',
'publishingEntityCompanyName',
'publishingEntityCompanyLogo',
'publishingEntityPersonName',
) );
$this->add_step( 'profileUrls', __( 'Social profiles', 'wordpress-seo' ), array(
'socialProfilesIntro',
'profileUrlFacebook',
'profileUrlTwitter',
'profileUrlInstagram',
'profileUrlLinkedIn',
'profileUrlMySpace',
'profileUrlPinterest',
'profileUrlYouTube',
'profileUrlGooglePlus',
) );
$fields = array( 'postTypeVisibility' );
$post_type_factory = new WPSEO_Config_Factory_Post_Type();
foreach ( $post_type_factory->get_fields() as $post_type_field ) {
$fields[] = $post_type_field->get_identifier();
}
$this->add_step( 'postTypeVisibility', __( 'Post type visibility', 'wordpress-seo' ), $fields );
$this->add_step( 'multipleAuthors', __( 'Multiple authors', 'wordpress-seo' ), array( 'multipleAuthors' ) );
$this->add_step( 'connectGoogleSearchConsole', __( 'Google Search Console', 'wordpress-seo' ), array(
'googleSearchConsoleIntro',
'connectGoogleSearchConsole',
) );
$this->add_step( 'titleTemplate', __( 'Title settings', 'wordpress-seo' ), array(
'titleIntro',
'siteName',
'separator',
) );
$this->add_step( 'newsletter', __( 'Newsletter', 'wordpress-seo' ), array(
'mailchimpSignup',
), true, true );
$this->add_step( 'suggestions', __( 'You might like', 'wordpress-seo' ), array(
'suggestions',
), true, true );
$this->add_step( 'success', __( 'Success!', 'wordpress-seo' ), array(
'successMessage',
), true, true );
}
/**
* Add a step to the structure
*
* @param string $identifier Identifier for this step.
* @param string $title Title to display for this step.
* @param array $fields Fields to use on the step.
* @param bool $navigation Show navigation buttons.
* @param bool $full_width Wheter the step content is full width or not.
*/
protected function add_step( $identifier, $title, $fields, $navigation = true, $full_width = false ) {
$this->steps[ $identifier ] = array(
'title' => $title,
'fields' => $fields,
'hideNavigation' => ! (bool) $navigation,
'fullWidth' => $full_width,
);
}
/**
* Retrieve the registered steps
*
* @return array
*/
public function retrieve() {
return $this->steps;
}
}