Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#41955 closed defect (bug) (invalid)

bug with wp_delete_user() and clean_user_cache()

Reported by: cyrille37's profile Cyrille37 Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.8.2
Component: Users Keywords:
Focuses: administration Cc:



The function wp_delete_user() do it's job then at end call clean_user_cache().

But clean_user_cache() test if user exists and load it. If the user does not exists clean_user_cache() does not clear the user cache !!
So while the user is deleted from database, the cache keep it forever ...


Change History (3)

#1 @Cyrille37
6 years ago

Here is the code excerpt :


function clean_user_cache( $user ) {
        if ( is_numeric( $user ) )
                $user = new WP_User( $user );

        if ( ! $user->exists() )

        wp_cache_delete( $user->ID, 'users' );

#2 @Cyrille37
6 years ago

  • Resolution set to invalid
  • Status changed from new to closed

No, this is not the bug, sorry.

The bug is somewhere else ...

#3 @SergeyBiryukov
6 years ago

  • Component changed from General to Users
  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.