wp_count_posts() cache is not destroyed after post inserts and deletions
|Reported by:||mark8barnes||Owned by:||wonderboymusic|
|Component:||Cache API||Keywords:||has-patch commit|
wp_count_posts() caches its results, but that cache is not destroyed when posts are inserted, deleted, or transitioned. This can lead to incorrect counts.
The attached patch fixes that (although it doesn't destroy the cache set when $perm='readable' in wp_count_posts(), which would be more complex as we wouldn't know the name of the key(s), though it could be done with preg_match).
Change History (8)
comment:3 wonderboymusic — 5 weeks ago
- Keywords needs-testing removed
- Milestone changed from Awaiting Review to 3.9