Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed : Disable Post via Email #6693

Open
wants to merge 9 commits into
base: trunk
Choose a base branch
from
26 changes: 13 additions & 13 deletions src/wp-admin/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -180,7 +192,6 @@
$allowed_options['general'][] = 'users_can_register';
$allowed_options['general'][] = 'default_role';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit-pick -- I'd leave this blank line between general and writing.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ironprogrammer Thanks for the feedback, I have implemented the suggestions.

$allowed_options['writing'] = array_merge( $allowed_options['writing'], $mail_options );
$allowed_options['writing'][] = 'ping_sites';

$allowed_options['media'][] = 'uploads_use_yearmonth_folders';
Expand All @@ -196,17 +207,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 );
}
}

/**
Expand Down
Loading