Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#35750 closed defect (bug) (fixed)

Updating a user should invalidate userslugs cache

Reported by: thebrandonallen Owned by: boonebgorges
Milestone: 4.5 Priority: normal
Severity: normal Version: 3.0
Component: Users Keywords: has-patch has-unit-tests
Focuses: Cc:


There are four user cache groups. However, between wp_insert_user and wp_update_user, only three of the groups are invalidated. The userslugs cache is never invalidated. Since a nicename can be updated via wp_update_user we should be invalidating the userslugs cache as well.

Attachments (1)

invalidate_userslugs_cache.patch (1.2 KB) - added by thebrandonallen 6 years ago.

Download all attachments as: .zip

Change History (5)

#1 @thebrandonallen
6 years ago

  • Keywords has-patch has-unit-tests added

#2 @boonebgorges
6 years ago

  • Milestone changed from Awaiting Review to 4.5

Good catch.

#3 @boonebgorges
6 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 36482:

When updating a user, invalidate its 'userslugs' cache.

user_nicename can be changed via wp_update_user(), so we invalidate just
to be safe.

Props thebrandonallen.
Fixes #35750.

#4 @johnbillion
6 years ago

  • Version changed from trunk to 3.0
Note: See TracTickets for help on using tickets.