|
158 | 158 | $allowed_options['options'] = array();
|
159 | 159 | $allowed_options['privacy'] = array();
|
160 | 160 |
|
161 |
| -$mail_options = array( 'mailserver_url', 'mailserver_port', 'mailserver_login', 'mailserver_pass' ); |
| 161 | +/** |
| 162 | + * Filters whether the post-by-email functionality is enabled. |
| 163 | + * |
| 164 | + * @since 3.0.0 |
| 165 | + * |
| 166 | + * @param bool $enabled Whether post-by-email configuration is enabled. Default true. |
| 167 | + */ |
| 168 | +if ( apply_filters( 'enable_post_by_email_configuration', true ) ) { |
| 169 | + $allowed_options['writing'][] = 'mailserver_url'; |
| 170 | + $allowed_options['writing'][] = 'mailserver_port'; |
| 171 | + $allowed_options['writing'][] = 'mailserver_login'; |
| 172 | + $allowed_options['writing'][] = 'mailserver_pass'; |
| 173 | +} |
162 | 174 |
|
163 | 175 | if ( ! is_utf8_charset() ) {
|
164 | 176 | $allowed_options['reading'][] = 'blog_charset';
|
|
180 | 192 | $allowed_options['general'][] = 'users_can_register';
|
181 | 193 | $allowed_options['general'][] = 'default_role';
|
182 | 194 |
|
183 |
| - $allowed_options['writing'] = array_merge( $allowed_options['writing'], $mail_options ); |
184 | 195 | if ( '1' === get_option( 'blog_public' ) ) {
|
185 | 196 | $allowed_options['writing'][] = 'ping_sites';
|
186 | 197 | }
|
|
198 | 209 | $allowed_options['media'][] = 'upload_path';
|
199 | 210 | $allowed_options['media'][] = 'upload_url_path';
|
200 | 211 | }
|
201 |
| -} else { |
202 |
| - /** |
203 |
| - * Filters whether the post-by-email functionality is enabled. |
204 |
| - * |
205 |
| - * @since 3.0.0 |
206 |
| - * |
207 |
| - * @param bool $enabled Whether post-by-email configuration is enabled. Default true. |
208 |
| - */ |
209 |
| - if ( apply_filters( 'enable_post_by_email_configuration', true ) ) { |
210 |
| - $allowed_options['writing'] = array_merge( $allowed_options['writing'], $mail_options ); |
211 |
| - } |
212 | 212 | }
|
213 | 213 |
|
214 | 214 | /**
|
|
0 commit comments