User deletion doesn't clear user_meta cache
|Reported by:||duck_||Owned by:||ryan|
wp_delete_user() and wpmu_delete_user() leave user_meta in the cache. Example:
get_user_meta( $user_id ); wp_delete_user( $user_id ); var_dump( is_user_member_of_blog( $user_id ) ); // bool(true) instead of bool(false)
- Extend clean_user_cache() to delete from user_meta too
- delete_user_meta() in wp_delete_user() instead of direct query
Ryan wasn't keen on 1 as "Most of the time clean_user_cache() doesn't need to touch meta cache".
- will introduce the delete(d)_user_meta actions when using wp_delete_user().
wp_cache_delete( $id, 'user_meta' ) in wp_delete_user() was also floated as a stop-gap measure, but since this will be fixed in a future release we can ignore the suggestion.
Change History (20)
comment:13 ryan — 2 years ago
- Owner set to ryan
- Resolution set to fixed
- Status changed from new to closed