More context for clean_post_cache()
|Reported by:||mdawaffe||Owned by:|
|Component:||Cache API||Keywords:||3.2-early needs-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.
Change History (15)
- Keywords 3.2-early added
- Milestone changed from Awaiting Review to Future Release