diff --git a/wp-admin/options-general.php b/wp-admin/options-general.php
index 822849c59..5edab2e19 100644
--- a/wp-admin/options-general.php
+++ b/wp-admin/options-general.php
@@ -106,9 +106,10 @@ include('./admin-header.php');
The new address will not become active until confirmed.') ?>
+$new_admin_email = get_option( 'new_admin_email' );
+if ( $new_admin_email && $new_admin_email != get_option('admin_email') ) : ?>
-
%s.'), $new_admin_email ); ?>
+
%1$s. Cancel '), $new_admin_email, esc_url( admin_url( 'options.php?dismiss=new_admin_email' ) ) ); ?>
diff --git a/wp-admin/options.php b/wp-admin/options.php
index dc8e16507..c7d6fc11b 100644
--- a/wp-admin/options.php
+++ b/wp-admin/options.php
@@ -75,17 +75,24 @@ if ( !is_multisite() ) {
$whitelist_options = apply_filters( 'whitelist_options', $whitelist_options );
-if ( is_multisite() && is_super_admin() && !empty($_GET[ 'adminhash' ]) ) {
- $new_admin_details = get_option( 'adminhash' );
- $redirect = admin_url('options-general.php?updated=false');
- if ( is_array( $new_admin_details ) && $new_admin_details[ 'hash' ] == $_GET[ 'adminhash' ] && !empty($new_admin_details[ 'newemail' ]) ) {
- update_option( 'admin_email', $new_admin_details[ 'newemail' ] );
+if ( is_multisite() && is_super_admin() ) {
+ if ( ! empty($_GET[ 'adminhash' ] ) ) {
+ $new_admin_details = get_option( 'adminhash' );
+ $redirect = 'options-general.php?updated=false';
+ if ( is_array( $new_admin_details ) && $new_admin_details[ 'hash' ] == $_GET[ 'adminhash' ] && !empty($new_admin_details[ 'newemail' ]) ) {
+ 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 ) );
+ exit;
+ } elseif ( ! empty( $_GET['dismiss'] ) && 'new_admin_email' == $_GET['dismiss'] ) {
delete_option( 'adminhash' );
delete_option( 'new_admin_email' );
- $redirect = admin_url('options-general.php?updated=true');
+ wp_redirect( admin_url( 'options-general.php?updated=true' ) );
+ exit;
}
- wp_redirect( $redirect);
- exit;
}
/**