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: https://develop.svn.wordpress.org/trunk@20523 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c0dd73f68d
commit
e8a29e70d6
|
@ -263,8 +263,6 @@ function wp_delete_user( $id, $reassign = 'novalue' ) {
|
||||||
$wpdb->update( $wpdb->links, array('link_owner' => $reassign), array('link_owner' => $id) );
|
$wpdb->update( $wpdb->links, array('link_owner' => $reassign), array('link_owner' => $id) );
|
||||||
}
|
}
|
||||||
|
|
||||||
clean_user_cache( $user );
|
|
||||||
|
|
||||||
// FINALLY, delete user
|
// FINALLY, delete user
|
||||||
if ( !is_multisite() ) {
|
if ( !is_multisite() ) {
|
||||||
$wpdb->delete( $wpdb->usermeta, array( 'user_id' => $id ) );
|
$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 ) );
|
$wpdb->delete( $wpdb->usermeta, array( 'user_id' => $id , 'meta_key' => $level_key ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clean_user_cache( $user );
|
||||||
|
|
||||||
// allow for commit transaction
|
// allow for commit transaction
|
||||||
do_action('deleted_user', $id);
|
do_action('deleted_user', $id);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue