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
This commit is contained in:
ryan 2010-01-26 17:51:50 +00:00
parent 416b218ef1
commit 389093009f
2 changed files with 6 additions and 9 deletions

View File

@ -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;

View File

@ -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();