[wp-trac] [WordPress Trac] #21879: wp_count_posts() cache is not destroyed after post inserts and deletions
WordPress Trac
wp-trac at lists.automattic.com
Thu Sep 13 02:11:19 UTC 2012
#21879: wp_count_posts() cache is not destroyed after post inserts and deletions
-------------------------------------+------------------------------
Reporter: mark8barnes | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Cache | Version: 3.4.2
Severity: normal | Resolution:
Keywords: has-patch needs-testing |
-------------------------------------+------------------------------
Comment (by mark8barnes):
Replying to [comment:1 nacin]:
> We don't bother with clearing the caches here because the counts group
is a non-persistent group. I wouldn't be surprised if we don't clean
caches for anything using the counts group.
I understand that, but you'll sometimes want to perform a bulk operation
and check post counts during the operation (in my case, I was trying to
prevent the last of a custom post type from being deleted). In that
scenario wp_count_posts() returns incorrect data.
(Another option would be to add a parameter to wp_count_posts() to
optionally ignore the cache.)
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21879#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list