WordPress.org

Make WordPress Core

Opened 10 months ago

Closed 10 months ago

Last modified 10 months ago

#41955 closed defect (bug) (invalid)

bug with wp_delete_user() and clean_user_cache()

Reported by: 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
10 months 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
10 months 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
10 months ago

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