wp_count_posts() cache is not destroyed after post inserts and deletions
|Reported by:||mark8barnes||Owned by:|
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).