WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/15/2010 05:18:00 PM (12 years ago)
Author:
nacin
Message:

Only show multisite admin email notice if the email was changed. Add a "Cancel" link so the nag doesn't stay forever if the admin ends up not changing the email. see #12192

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/options.php

    r13661 r13705  
    7676$whitelist_options = apply_filters( 'whitelist_options', $whitelist_options );
    7777
    78 if ( is_multisite() && is_super_admin() && !empty($_GET[ 'adminhash' ]) ) {
    79     $new_admin_details = get_option( 'adminhash' );
    80     $redirect = admin_url('options-general.php?updated=false');
    81     if ( is_array( $new_admin_details ) && $new_admin_details[ 'hash' ] == $_GET[ 'adminhash' ] && !empty($new_admin_details[ 'newemail' ]) ) {
    82         update_option( 'admin_email', $new_admin_details[ 'newemail' ] );
     78if ( is_multisite() && is_super_admin() ) {
     79    if ( ! empty($_GET[ 'adminhash' ] ) ) {
     80        $new_admin_details = get_option( 'adminhash' );
     81        $redirect = 'options-general.php?updated=false';
     82        if ( is_array( $new_admin_details ) && $new_admin_details[ 'hash' ] == $_GET[ 'adminhash' ] && !empty($new_admin_details[ 'newemail' ]) ) {
     83            update_option( 'admin_email', $new_admin_details[ 'newemail' ] );
     84            delete_option( 'adminhash' );
     85            delete_option( 'new_admin_email' );
     86            $redirect = 'options-general.php?updated=true';
     87        }
     88        wp_redirect( admin_url( $redirect ) );
     89        exit;
     90    } elseif ( ! empty( $_GET['dismiss'] ) && 'new_admin_email' == $_GET['dismiss'] ) {
    8391        delete_option( 'adminhash' );
    8492        delete_option( 'new_admin_email' );
    85         $redirect = admin_url('options-general.php?updated=true');
    86     }
    87     wp_redirect( $redirect);
    88     exit;
     93        wp_redirect( admin_url( 'options-general.php?updated=true' ) );
     94        exit;
     95    }
    8996}
    9097
Note: See TracChangeset for help on using the changeset viewer.