Pods with WP Super Cache, clear post-save

0

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

asked Mar 9 '10 at 6:41

bmills

16

add comment
enter at least 15 characters

3 Answers

0

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>

answered Mar 9 '10 at 6:41

logikal16

249

add comment
enter at least 15 characters
0

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

answered Aug 18 '10 at 9:36

erwanpia

1

add comment
enter at least 15 characters
0

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?

answered Sep 8 '10 at 5:43

acenik

1

add comment
enter at least 15 characters