[wp-trac] [WordPress Trac] #61144: Disable Post via email
WordPress Trac
noreply at wordpress.org
Sat May 4 05:00:21 UTC 2024
#61144: Disable Post via email
--------------------------+-----------------------------
Reporter: manbo | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 6.5
Severity: minor | Keywords:
Focuses: |
--------------------------+-----------------------------
If you disable Post via email on the management screen, an error will
occur when you press the save button.
{{{#!php
add_filter( 'enable_post_by_email_configuration', '__return_false' );
}}}
{{{#!php
# PHP Deprecated: strip_tags(): Passing null to parameter #1 ($string) of
type string is deprecated in /wp-includes/formatting.php on line 4958
}}}
As a makeshift measure, I suppressed the error using the following method.
{{{#!php
add_action( 'update_option', function() {
if( isset( $_POST['option_page'] ) && $_POST['option_page'] ===
'writing' ) {
if( !isset( $_POST['mailserver_url'] ) ) {
$_POST['mailserver_url'] = '';
}
if( !isset( $_POST['mailserver_login'] ) ) {
$_POST['mailserver_login'] = '';
}
if( !isset( $_POST['mailserver_pass'] ) ) {
$_POST['mailserver_pass'] = '';
}
}
} );
}}}
Please improve it so that saving the three items to the database is
ignored when email posting is disabled.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/61144>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list