[wp-trac] [WordPress Trac] #42967: New admin email change featuer should be rolled back
WordPress Trac
noreply at wordpress.org
Sat Dec 23 23:45:24 UTC 2017
#42967: New admin email change featuer should be rolled back
-----------------------------+------------------------------
Reporter: johndeebdd | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Security | Version: 4.9
Severity: normal | Resolution:
Keywords: close | Focuses:
-----------------------------+------------------------------
Comment (by NathanAtmoz):
The changes in #39118 are beneficial to the majority of use cases and I
don't think they should be reverted.
In the case that you're a sys admin, and you want to changed the site
email, and outgoing email is not available, and you're unable to query the
database to update the administrator password field, then you can add the
following as a must-use plugin:
{{{
add_action( 'load-options-general.php', function() {
$new_admin_details = get_option( 'adminhash' );
if( is_array( $new_admin_details) && ! empty( $new_admin_details ) ) {
update_option( 'admin_email', $new_admin_details[ 'newemail' ] );
delete_option( 'adminhash' );
delete_option( 'new_admin_email' );
$redirect = 'options-general.php?updated=true';
wp_redirect( admin_url( $redirect ) );
}
});
}}}
Then you'll be able to change the email addresses on the Options General
page without email confirmation.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42967#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list