Ticket #11358: update-name-in-comment-with-display-name.patch
| File update-name-in-comment-with-display-name.patch, 930 bytes (added by k_nitin_r, 3 years ago) |
|---|
-
registration.php
185 185 if ( $update ) { 186 186 $wpdb->update( $wpdb->users, $data, compact( 'ID' ) ); 187 187 $user_id = (int) $ID; 188 189 //if the display name has changed, also update the display name in the comments 190 if ($old_user_data->display_name != $data['display_name']) { 191 $wpdb->update( 192 $wpdb->comments, //comments table 193 array('comment_author' => $data['display_name']), //update comment author name 194 array('user_id' => $user_id), //comment author's user ID 195 array('%s'), //comment author name is a string 196 array('%d') //comment author's user ID is an integer 197 ); 198 } 199 188 200 } else { 189 201 $wpdb->insert( $wpdb->users, $data + compact( 'user_login' ) ); 190 202 $user_id = (int) $wpdb->insert_id;
