Ticket #5787: comment_user_info.diff
File comment_user_info.diff, 1.4 KB (added by , 16 years ago) |
---|
-
registration.php
207 207 * If $userdata does not contain an 'ID' key, then a new user 208 208 * will be created and the new user's ID will be returned. 209 209 * 210 * Updates the user's past comments with the new display name, 211 * email address, and URL, if changed. 212 * 210 213 * If current user's password is being updated, then the cookies 211 214 * will be cleared. 212 215 * … … 218 221 * @return int The updated user's ID. 219 222 */ 220 223 function wp_update_user($userdata) { 224 global $wpdb; 225 221 226 $ID = (int) $userdata['ID']; 222 227 223 228 // First, get all of the original fields … … 232 237 $userdata['user_pass'] = wp_hash_password($userdata['user_pass']); 233 238 } 234 239 240 // Update user data in the comments if display name, email, or URL has changed 241 if ( ($user['display_name'] != $userdata['display_name']) || ($user['user_email'] != $userdata['user_email']) || ($user['user_url'] != $userdata['user_url']) ) 242 $wpdb->query("UPDATE $wpdb->comments SET comment_author = '{$userdata['display_name']}', comment_author_email = '{$userdata['user_email']}', comment_author_url = '{$userdata['user_url']}' WHERE user_id = '$ID'"); 243 235 244 // Merge old and new fields with new fields overwriting old ones. 236 245 $userdata = array_merge($user, $userdata); 237 246 $user_id = wp_insert_user($userdata);