WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/02/2010 06:00:45 PM (11 years ago)
Author:
ryan
Message:

Integrate update_profile_email() into user-edit.php. see #11644

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/ms.php

    r12920 r12928  
    267267add_action('update_option_new_admin_email', 'update_option_new_admin_email', 10, 2);
    268268
    269 function update_profile_email() {
    270     global $current_user, $wpdb;
    271     if ( isset( $_GET[ 'newuseremail' ] ) && $current_user->ID ) {
    272         $new_email = get_option( $current_user->ID . '_new_email' );
    273         if ( $new_email[ 'hash' ] == $_GET[ 'newuseremail' ] ) {
    274             $user->ID = $current_user->ID;
    275             $user->user_email = wp_specialchars( trim( $new_email[ 'newemail' ] ) );
    276             if ( $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", $current_user->user_login ) ) )
    277                 $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s", $user->user_email, $current_user->user_login ) );
    278             wp_update_user( get_object_vars( $user ) );
    279             delete_option( $current_user->ID . '_new_email' );
    280             wp_redirect( add_query_arg( array('updated' => 'true'), admin_url( 'profile.php' ) ) );
    281             die();
    282         }
    283     }
    284 }
    285 
    286269function send_confirmation_on_profile_email() {
    287270    global $errors, $wpdb, $current_user, $current_site;
     
    804787}
    805788
    806 if ( strpos( $_SERVER['PHP_SELF'], 'profile.php' ) ) {
    807     add_action( 'admin_init', 'update_profile_email' );
    808 }
    809 
    810789function stripslashes_from_options( $blog_id ) {
    811790    global $wpdb;
Note: See TracChangeset for help on using the changeset viewer.