You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'description' => __( 'Default Author ID for this Site', 'indieweb' ),
53
+
'description' => \__( 'Default Author ID for this Site', 'indieweb' ),
56
54
'show_in_rest' => true,
57
55
'default' => 1,
58
56
)
59
57
);
60
58
61
-
register_setting(
59
+
\register_setting(
62
60
$section,
63
61
'iw_author_url',
64
62
array(
65
63
'type' => 'boolean',
66
-
'description' => __( 'Replace Author URL with User Website URL', 'indieweb' ),
64
+
'description' => \__( 'Replace Author URL with User Website URL', 'indieweb' ),
67
65
'show_in_rest' => true,
68
66
'default' => 1,
69
67
)
70
68
);
71
69
72
-
register_setting(
70
+
\register_setting(
73
71
$section,
74
72
'iw_relme_bw',
75
73
array(
76
74
'type' => 'boolean',
77
-
'description' => __( 'Black and White Rel-Me Icons', 'indieweb' ),
75
+
'description' => \__( 'Black and White Rel-Me Icons', 'indieweb' ),
78
76
'show_in_rest' => true,
79
77
'default' => 0,
80
78
)
@@ -89,56 +87,56 @@ public static function admin_settings() {
89
87
// Settings Section.
90
88
$section = 'iw_identity_settings';
91
89
92
-
add_settings_section(
90
+
\add_settings_section(
93
91
$section, // ID used to identify this section and with which to register options.
94
-
__( 'Identity Settings', 'indieweb' ), // Title to be displayed on the administration page.
95
-
array( 'IndieWeb_General_Settings', 'identity_options_callback' ), // Callback used to render the description of the section.
92
+
\__( 'Identity Settings', 'indieweb' ), // Title to be displayed on the administration page.
93
+
array( self::class, 'identity_options_callback' ), // Callback used to render the description of the section.
96
94
$page// Page on which to add this section of options.
97
95
);
98
96
99
-
add_settings_field(
97
+
\add_settings_field(
100
98
'iw_single_author', // ID used to identify the field throughout the theme.
101
99
'Single Author Site', // The label to the left of the option interface element.
102
-
array( 'IndieWeb_General_Settings', 'checkbox_callback' ), // The name of the function responsible for rendering the option interface.
100
+
array( self::class, 'checkbox_callback' ), // The name of the function responsible for rendering the option interface.
103
101
$page, // The page on which this option will be displayed.
104
102
$section, // The name of the section to which this field belongs.
105
103
array( // The array of arguments to pass to the callback. In this case, just a description.
106
104
'name' => 'iw_single_author',
107
-
'description' => __( 'If this website represents a single individual or entity, check this. This setting is disabled if you only have one user who has made a post.', 'indieweb' ),
108
-
'disabled' => ! is_multi_author(),
105
+
'description' => \__( 'If this website represents a single individual or entity, check this. This setting is disabled if you only have one user who has made a post.', 'indieweb' ),
106
+
'disabled' => ! \is_multi_author(),
109
107
)
110
108
);
111
109
112
-
add_settings_field(
110
+
\add_settings_field(
113
111
'iw_default_author', // ID used to identify the field throughout the theme.
114
112
'Default Author', // The label to the left of the option interface element.
115
-
array( 'IndieWeb_General_Settings', 'default_author_callback' ), // The name of the function responsible for rendering the option interface.
113
+
array( self::class, 'default_author_callback' ), // The name of the function responsible for rendering the option interface.
116
114
$page, // The page on which this option will be displayed.
117
115
$section// The name of the section to which this field belongs.
118
116
);
119
117
120
-
add_settings_field(
118
+
\add_settings_field(
121
119
'iw_author_url', // ID used to identify the field throughout the theme.
122
-
__( 'Use User Website URL for Author', 'indieweb' ), // The label to the left of the option interface element.
123
-
array( 'IndieWeb_General_Settings', 'checkbox_callback' ), // The name of the function responsible for rendering the option interface.
120
+
\__( 'Use User Website URL for Author', 'indieweb' ), // The label to the left of the option interface element.
121
+
array( self::class, 'checkbox_callback' ), // The name of the function responsible for rendering the option interface.
124
122
$page, // The page on which this option will be displayed.
125
123
$section, // The name of the section to which this field belongs.
126
124
array( // The array of arguments to pass to the callback. In this case, just a description.
127
125
'name' => 'iw_author_url',
128
-
'description' => __( 'If checked, this will replace the author page URL with the website URL from your user profile.', 'indieweb' ),
126
+
'description' => \__( 'If checked, this will replace the author page URL with the website URL from your user profile.', 'indieweb' ),
129
127
'disabled' => false,
130
128
)
131
129
);
132
130
133
-
add_settings_field(
131
+
\add_settings_field(
134
132
'iw_relme_bw', // ID used to identify the field throughout the theme.
135
-
__( 'Black and White Icons', 'indieweb' ), // The label to the left of the option interface element.
136
-
array( 'IndieWeb_General_Settings', 'checkbox_callback' ), // The name of the function responsible for rendering the option interface.
133
+
\__( 'Black and White Icons', 'indieweb' ), // The label to the left of the option interface element.
134
+
array( self::class, 'checkbox_callback' ), // The name of the function responsible for rendering the option interface.
137
135
$page, // The page on which this option will be displayed.
138
136
$section, // The name of the section to which this field belongs.
139
137
array( // The array of arguments to pass to the callback. In this case, just a description.
140
138
'name' => 'iw_relme_bw',
141
-
'description' => __( 'If checked, the icon colors will not be loaded', 'indieweb' ),
139
+
'description' => \__( 'If checked, the icon colors will not be loaded', 'indieweb' ),
142
140
'disabled' => false,
143
141
)
144
142
);
@@ -150,15 +148,15 @@ public static function admin_settings() {
150
148
*/
151
149
publicstaticfunctionidentity_options_callback() {
152
150
echo'<p>';
153
-
esc_html_e(
151
+
\esc_html_e(
154
152
'Using rel=me on a link indicates the link represents the same person or entity as
155
153
the current page. On a site with a single author, links to other profiles from their user profile will
156
154
appear on the homepage. On a site with multiple authors these links will appear on the author page only.',
157
155
'indieweb'
158
156
);
159
157
echo'</p>';
160
158
echo'<p>';
161
-
esc_html_e(
159
+
\esc_html_e(
162
160
'The Default Author is the one whose that will be used on the home pages and archive pages. If the single author setting is not set,
163
161
on all other pages, the post author links will be used. To display the links, add the
164
162
widget, otherwise they will remain hidden. ',
@@ -172,17 +170,17 @@ public static function identity_options_callback() {
172
170
*/
173
171
publicstaticfunctiongeneral_options_page() {
174
172
// If this is not a multi-author site, remove the single author setting.
175
-
if ( ! is_multi_author() ) {
176
-
delete_option( 'iw_single_author' );
173
+
if ( ! \is_multi_author() ) {
174
+
\delete_option( 'iw_single_author' );
177
175
}
178
176
179
177
echo'<div class="wrap">';
180
178
echo' <form method="post" action="options.php">';
181
179
182
-
settings_fields( 'iw_identity_settings' );
183
-
do_settings_sections( 'iw_general_options' );
180
+
\settings_fields( 'iw_identity_settings' );
181
+
\do_settings_sections( 'iw_general_options' );
184
182
185
-
submit_button();
183
+
\submit_button();
186
184
187
185
echo' </form>';
188
186
echo'</div>';
@@ -194,38 +192,38 @@ public static function general_options_page() {
0 commit comments