#54316 closed defect (bug) (fixed)
clean_user_cache() doesn't clear the user_meta cache
Reported by: | dd32 | Owned by: | spacedmonkey |
---|---|---|---|
Milestone: | 6.2 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Users | Keywords: | has-patch has-unit-tests commit |
Focuses: | Cc: |
Description
Calling clean_user_cache() doesn't clear the user_meta cache, which can cause odd behaviours when the reason for calling it is that the user or usermeta DB tables have been altered.
Additionally, there is no API for clearing the metadata caches, other than performing a direct wp_cache_delete( $id, 'user_meta' );
.
See attached PR.
Change History (10)
This ticket was mentioned in PR #1776 on WordPress/wordpress-develop by dd32.
3 years ago
#1
- Keywords has-patch added
This ticket was mentioned in PR #3447 on WordPress/wordpress-develop by @dd32.
2 years ago
#2
This is intended as a simple version of #1776
Trac ticket: https://core.trac.wordpress.org/ticket/54316
2 years ago
#3
I've refreshed this against trunk, but also opened #3447 which is a simpler straight to the point fix.
#4
@
2 years ago
- Milestone changed from Awaiting Review to 6.2
- Owner set to spacedmonkey
- Status changed from new to assigned
2 years ago
#6
Just noting that I've force-pushed this around a little to run a unit test that fails (for users, passes for posts) first, and then the original commit on top of that showing the unit test passing.
Posts passed originally as clean_post_cache()
calls the same wp_cache_delete()
, see https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/post.php#L7373
@spacedmonkey commented on PR #3447:
2 years ago
#10
Committed
Trac ticket: https://core.trac.wordpress.org/ticket/54316