diff --git a/src/wp-admin/options.php b/src/wp-admin/options.php index 6916e2e25c990..8348b24c8e941 100644 --- a/src/wp-admin/options.php +++ b/src/wp-admin/options.php @@ -158,7 +158,19 @@ $allowed_options['options'] = array(); $allowed_options['privacy'] = array(); -$mail_options = array( 'mailserver_url', 'mailserver_port', 'mailserver_login', 'mailserver_pass' ); +/** + * Filters whether the post-by-email functionality is enabled. + * + * @since 3.0.0 + * + * @param bool $enabled Whether post-by-email configuration is enabled. Default true. + */ +if ( apply_filters( 'enable_post_by_email_configuration', true ) ) { + $allowed_options['writing'][] = 'mailserver_url'; + $allowed_options['writing'][] = 'mailserver_port'; + $allowed_options['writing'][] = 'mailserver_login'; + $allowed_options['writing'][] = 'mailserver_pass'; +} if ( ! is_utf8_charset() ) { $allowed_options['reading'][] = 'blog_charset'; @@ -180,7 +192,6 @@ $allowed_options['general'][] = 'users_can_register'; $allowed_options['general'][] = 'default_role'; - $allowed_options['writing'] = array_merge( $allowed_options['writing'], $mail_options ); if ( '1' === get_option( 'blog_public' ) ) { $allowed_options['writing'][] = 'ping_sites'; } @@ -198,17 +209,6 @@ $allowed_options['media'][] = 'upload_path'; $allowed_options['media'][] = 'upload_url_path'; } -} else { - /** - * Filters whether the post-by-email functionality is enabled. - * - * @since 3.0.0 - * - * @param bool $enabled Whether post-by-email configuration is enabled. Default true. - */ - if ( apply_filters( 'enable_post_by_email_configuration', true ) ) { - $allowed_options['writing'] = array_merge( $allowed_options['writing'], $mail_options ); - } } /**