From 53e6ba79595c60eb0d11aa50b6c3fa144cf771fc Mon Sep 17 00:00:00 2001 From: duck_ Date: Wed, 18 Apr 2012 21:24:53 +0000 Subject: [PATCH] clean_user_cache() after the DELETE query in wp_delete_user(). See #20460. This is to prevent plugins managing to hook in between the cache cleaning and the actual deletion. git-svn-id: http://svn.automattic.com/wordpress/trunk@20523 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/user.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/user.php b/wp-admin/includes/user.php index cdff2e40e..0fa1a9793 100644 --- a/wp-admin/includes/user.php +++ b/wp-admin/includes/user.php @@ -263,8 +263,6 @@ function wp_delete_user( $id, $reassign = 'novalue' ) { $wpdb->update( $wpdb->links, array('link_owner' => $reassign), array('link_owner' => $id) ); } - clean_user_cache( $user ); - // FINALLY, delete user if ( !is_multisite() ) { $wpdb->delete( $wpdb->usermeta, array( 'user_id' => $id ) ); @@ -274,6 +272,8 @@ function wp_delete_user( $id, $reassign = 'novalue' ) { $wpdb->delete( $wpdb->usermeta, array( 'user_id' => $id , 'meta_key' => $level_key ) ); } + clean_user_cache( $user ); + // allow for commit transaction do_action('deleted_user', $id);