[wp-trac] [WordPress Trac] #15644: When deleting a user, corresponding comment user IDs aren't reset

WordPress Trac wp-trac at lists.automattic.com
Thu Dec 2 11:19:18 UTC 2010


#15644: When deleting a user, corresponding comment user IDs aren't reset
--------------------------+-------------------------------------------------
 Reporter:  nacin         |       Owner:                
     Type:  defect (bug)  |      Status:  new           
 Priority:  normal        |   Milestone:  Future Release
Component:  Comments      |     Version:                
 Severity:  normal        |    Keywords:  has-patch gci 
--------------------------+-------------------------------------------------
 Delete a user with a comment.

 The user ID stays.

 Potential for clashes later.

 We should run this: `$wpdb->update( $wpdb->comments, array( 'user_id' => 0
 ), array( 'user_id' => $user_id ) );` in wp_delete_user.

 Alternative is to do a full query then manually run wp_insert_comment() on
 each, so all hooks get fired, which is fine too and is more in line with
 what we do elsewhere.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/15644>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list