Pods with WP Super Cache, clear post-save
Hi, I want to use Pods with WP Super Cache, and running into problem in areas where I'm using the Pods API to pull data directly into a page (as opposed to using a Pods page). I'd like to use the wp_cache_clear_cache() as a post-save helper, but when I use it, nothing happens.
In my post-save helper: <pre><?php wp_cache_clear_cache(); ?></pre>
The helper doesn't report any errors, but then again, I don't know if it would.
Has anyone used this or done something similar?
Thanks, Bryan
3 Answers
I haven't tried it, but this will return an error on failure:
<pre><?php if (!function_exists('wp_cache_clear_cache')) { die('Error: cache not cleared!'); } ?></pre>
Hi,
the cache should be totally refreshed when a post is saved, and this is performed via the wp_update_nav_menu action, instantiated in the wp-cache-phase2.php / wp\_cache\_phase2 function. Add the following :
add_action('pods_post_save_pod_item','wp_cache_clear_cache');
more @ webmasterbulletin wp-super-cache clear for menus and pods
thanks works great but is there a way to use more hooks for instance i used add_action('pods_post_save_pod_item','wp_cache_clear_cache'); add_action('pods_post_drop_pod_item','wp_cache_clear_cache');
was wondering if there's a need to use these hooks too & do an add_action() respectively? drop_page drop_pod drop_pod_item save_template save_pod save_pod_item
i spoke on the IRC they said that version 2.0 will be having a combined hook or a better solution to this, but till then could u advice me if this is ok to go ahead with, is there a need & will it work?


