From 389093009f995cc82c95b07fc460e84d3994ab2d Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 26 Jan 2010 17:51:50 +0000 Subject: [PATCH] Move update_signup_email_from_profile() logic into user-edit.php. see #11644 git-svn-id: http://svn.automattic.com/wordpress/trunk@12842 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/ms.php | 9 --------- wp-admin/user-edit.php | 6 ++++++ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/wp-admin/includes/ms.php b/wp-admin/includes/ms.php index 26c054a81a..a000c0780a 100644 --- a/wp-admin/includes/ms.php +++ b/wp-admin/includes/ms.php @@ -1161,15 +1161,6 @@ function blogs_page_init() { } add_action('admin_menu', 'blogs_page_init'); -function update_signup_email_from_profile( $user_id ) { - global $wpdb; - $user_login = $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->users} WHERE ID = %d", $user_id ) ); - if ( $user_login && is_email( $_POST[ 'email' ] ) && $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", $user_login ) ) ) { - $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s", $_POST[ 'email' ], $user_login ) ); - } -} -add_action( 'edit_user_profile_update', 'update_signup_email_from_profile' ); - function stripslashes_from_options( $blog_id ) { global $wpdb; diff --git a/wp-admin/user-edit.php b/wp-admin/user-edit.php index 2aa81296c2..39cb365ae2 100644 --- a/wp-admin/user-edit.php +++ b/wp-admin/user-edit.php @@ -89,6 +89,12 @@ else if ( !is_multisite() ) { $errors = edit_user($user_id); } else { + $user = get_userdata( $user_id ); + + // Update the email address in signups, if present. + 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 ) ) ) + $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s", $_POST[ 'email' ], $user_login ) ); + // WPMU must delete the user from the current blog if WP added him after editing. $delete_role = false; $blog_prefix = $wpdb->get_blog_prefix();