[wp-trac] [WordPress Trac] #15565: More context for clean_post_cache()
WordPress Trac
wp-trac at lists.automattic.com
Wed Nov 24 17:41:07 UTC 2010
#15565: More context for clean_post_cache()
-----------------------------+----------------------------------------------
Reporter: mdawaffe | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Cache | Version: 3.1
Severity: normal | Keywords: has-patch
-----------------------------+----------------------------------------------
I'd like more context to be available when the clean_post_cache hook is
run.
Scenario: I have a plugin caches the post_IDs of most post queries that go
through WP_Query. Invalidating that cache is done via the
clean_post_cache hook, but requires a bunch of fragile hacks to prevent
cache invalidation for things like comment inserts, which update the
post's comment_count (which could, in theory, affect a WP_Query, but
that's another story).
Option 1: Add extra actions to provide context. This is the simpler
option. Patch 1 does this for the above scenario.
Option 2: Add an optional context parameter to clean_post_cache(). This
is more general, but I can't think of anyplace else WordPress uses as
similar approach. Patch two.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/15565>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list