Skip to content

Commit

Permalink
Move update_signup_email_from_profile() logic into user-edit.php. see…
Browse files Browse the repository at this point in the history
… #11644

git-svn-id: http://svn.automattic.com/wordpress/trunk@12842 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
ryan committed Jan 26, 2010
1 parent 416b218 commit 3890930
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
9 changes: 0 additions & 9 deletions wp-admin/includes/ms.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
6 changes: 6 additions & 0 deletions wp-admin/user-edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ function use_ssl_preference($user) {
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();
Expand Down

0 comments on commit 3890930

Please sign in to comment.