WordPress.org

Make WordPress Core

Changeset 12842


Ignore:
Timestamp:
01/26/2010 05:51:50 PM (11 years ago)
Author:
ryan
Message:

Move update_signup_email_from_profile() logic into user-edit.php. see #11644

Location:
trunk/wp-admin
Files:
2 edited

Legend:

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

    r12841 r12842  
    11621162add_action('admin_menu', 'blogs_page_init');
    11631163
    1164 function update_signup_email_from_profile( $user_id ) {
    1165     global $wpdb;
    1166     $user_login = $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->users} WHERE ID = %d", $user_id ) );
    1167     if ( $user_login && is_email( $_POST[ 'email' ] ) && $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", $user_login ) ) ) {
    1168         $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s", $_POST[ 'email' ], $user_login ) );
    1169     }
    1170 }
    1171 add_action( 'edit_user_profile_update', 'update_signup_email_from_profile' );
    1172 
    11731164function stripslashes_from_options( $blog_id ) {
    11741165    global $wpdb;
  • trunk/wp-admin/user-edit.php

    r12789 r12842  
    9090    $errors = edit_user($user_id);
    9191} else {
     92    $user = get_userdata( $user_id );
     93
     94    // Update the email address in signups, if present.
     95    if ( $user->user_login && isset( $_POST[ 'email' ] ) && is_email( $_POST[ 'email' ] ) && $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", $user->user_login ) ) )
     96        $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s", $_POST[ 'email' ], $user_login ) );
     97
    9298    // WPMU must delete the user from the current blog if WP added him after editing.
    9399    $delete_role = false;
Note: See TracChangeset for help on using the changeset viewer.