Changeset 12766 for trunk/wp-admin/includes/user.php
- Timestamp:
- 01/19/2010 07:23:11 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/user.php
r12755 r12766 420 420 * @return bool True when finished. 421 421 */ 422 function wp_delete_user( $id, $reassign = 'novalue') {422 function wp_delete_user( $id, $reassign = 'novalue' ) { 423 423 global $wpdb; 424 424 … … 429 429 do_action('delete_user', $id); 430 430 431 if ( $reassign == 'novalue') {431 if ( 'novalue' === $reassign || null === $reassign ) { 432 432 $post_ids = $wpdb->get_col( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_author = %d", $id) ); 433 433 434 if ( $post_ids) {435 foreach ( $post_ids as $post_id)434 if ( $post_ids ) { 435 foreach ( $post_ids as $post_id ) 436 436 wp_delete_post($post_id); 437 437 } … … 444 444 wp_delete_link($link_id); 445 445 } 446 447 446 } else { 448 447 $reassign = (int) $reassign; … … 460 459 } 461 460 462 wp_cache_delete($id, 'users'); 463 wp_cache_delete($user->user_login, 'userlogins'); 464 wp_cache_delete($user->user_email, 'useremail'); 465 wp_cache_delete($user->user_nicename, 'userslugs'); 461 clean_user_cache($id); 466 462 467 463 // allow for commit transaction
Note: See TracChangeset
for help on using the changeset viewer.