Make WordPress Core

Opened 3 months ago

Last modified 6 weeks ago

#47021 reviewing defect (bug)

Use clean_user_cache in more places.

Reported by: spacedmonkey Owned by: SergeyBiryukov
Milestone: 5.3 Priority: normal
Severity: normal Version: 5.1
Component: Users Keywords: has-patch commit
Focuses: Cc:


There are a number of places in core that should use the clean_user_cache function. This so all caches are correctly cleared / invalidated and the clean_user_cache action is fired.

Attachments (3)

47021.diff (1.6 KB) - added by spacedmonkey 3 months ago.
47021.2.diff (1.7 KB) - added by spacedmonkey 3 months ago.
47021.3.diff (2.0 KB) - added by spacedmonkey 3 months ago.

Download all attachments as: .zip

Change History (8)

3 months ago

#1 @mukesh27
3 months ago

@spacedmonkey, In wp-includes/user.php file, wp_update_user function can we also remove below code with new code.

wp_cache_delete( $user['user_email'], 'useremail' );
wp_cache_delete( $user['user_nicename'], 'userslugs' );

Replace with new below code

clean_user_cache( $ID );
Last edited 3 months ago by mukesh27 (previous) (diff)

#2 @spacedmonkey
3 months ago

  • Milestone changed from Awaiting Review to Future Release

Good catch @mukesh27

I have updated the patch with 47021.3.diff. I did some testing and ran the unit tests. Tests pass.

#3 @spacedmonkey
7 weeks ago

  • Milestone changed from Future Release to 5.3

#4 @SergeyBiryukov
6 weeks ago

  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#5 @SergeyBiryukov
6 weeks ago

  • Keywords commit added
Note: See TracTickets for help on using tickets.