Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 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:

Description

Hi,

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 ...

Cheers.

Change History (3)

#1 @Cyrille37
7 years ago

Here is the code excerpt :

<?php

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

        if ( ! $user->exists() )
                return;

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

#2 @Cyrille37
7 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
7 years ago

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