Ticket #9422: 9422-user-delete-transaction.diff
File 9422-user-delete-transaction.diff, 1.0 KB (added by , 16 years ago) |
---|
-
Users/denis/Sites/wp/wp-admin/includes/user.php
411 411 global $wpdb; 412 412 413 413 $id = (int) $id; 414 415 // allow for transaction statement 416 do_action('delete_user', $id); 414 417 415 418 if ($reassign == 'novalue') { 416 419 $post_ids = $wpdb->get_col( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_author = %d", $id) ); … … 429 432 } 430 433 431 434 // FINALLY, delete user 432 do_action('delete_user', $id);433 435 434 436 $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d", $id) ); 435 437 $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->users WHERE ID = %d", $id) ); … … 439 441 wp_cache_delete($id, 'users'); 440 442 wp_cache_delete($user->user_login, 'userlogins'); 441 443 wp_cache_delete($user->user_email, 'useremail'); 444 445 // allow for commit transaction 446 do_action('deleted_user', $id); 442 447 443 448 return true; 444 449 }