Enabling Cache support breaks filter API
-
Before I get into this I do want to say Thank You for a great plugin very well written easy to read. So thank you very much..
On my website I have a need to dynamically bar certain post ID’s from showing up in the results. To accomplish this I’m using the filter API ‘get_crp_posts_id’. (oh sorry I’m using: crp ver 2.2.3)
At first my filter was not getting executed and I couldn’t figure it out. What I found was, when the cache was enabled many of the APIs are never applied.
I isolated it down to line 128 in contextual-related-posts.php in the get_crp() routine. If the $output is valid there’s a ‘return $output;’ and it exits the get_crp() routine. This makes all the following apply_filter()’s unreachable hence not hookable by themes when caching is enabled.
I don’t know if this is the spec’d behavior or just an oversight, in the case it’s the later I thought I’d bring it to your attention. If it’s as spec’d a you might want to add a FAQ blurb..
Cheers & Thanks!!
Todd Martinhttps://www.ads-software.com/plugins/contextual-related-posts/
- The topic ‘Enabling Cache support breaks filter API’ is closed to new replies.