WordPress.org

Make WordPress Core

Ticket #13457: cancel-new-user-email.diff

File cancel-new-user-email.diff, 1.5 KB (added by mtdewvirus, 4 years ago)
  • wp-admin/user-edit.php

     
    7474                wp_redirect( add_query_arg( array('updated' => 'true'), admin_url( 'profile.php' ) ) ); 
    7575                die(); 
    7676        } 
     77} elseif ( is_multisite() && IS_PROFILE_PAGE && !empty( $_GET['dismiss'] ) && $current_user->ID . '_new_email' == $_GET['dismiss'] ) { 
     78        delete_option( $current_user->ID . '_new_email' ); 
     79        wp_redirect( add_query_arg( array('updated' => 'true'), admin_url( 'profile.php' ) ) ); 
     80        die(); 
    7781} 
    7882 
    7983switch ($action) { 
     
    285289<table class="form-table"> 
    286290<tr> 
    287291        <th><label for="email"><?php _e('E-mail'); ?> <span class="description"><?php _e('(required)'); ?></span></label></th> 
    288         <td><input type="text" name="email" id="email" value="<?php echo esc_attr($profileuser->user_email) ?>" class="regular-text" /></td> 
     292        <td><input type="text" name="email" id="email" value="<?php echo esc_attr($profileuser->user_email) ?>" class="regular-text" /> 
     293        <?php 
     294        $new_email = get_option( $current_user->ID . '_new_email' ); 
     295        if ( $new_email && $new_email != $current_user->user_email ) : ?> 
     296        <div class="updated inline"> 
     297        <p><?php printf( __('There is a pending change of your e-mail to <code>%1$s</code>. <a href="%2$s">Cancel</a>'), $new_email['newemail'], esc_url( admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ) ) ); ?></p> 
     298        </div> 
     299        <?php endif; ?> 
     300        </td> 
    289301</tr> 
    290302 
    291303<tr>