Clean cache automatically when you publish
-
Hi,
I am using the plugin W3 Total Cache but now I need to clear the cache automatically when an entry is posted. How can this be done? I have tried to create a function in the functions.php file of my template but it does not work well. I paste the code I use.
function post_delete_cache( $ID, $post ) { if (function_exists('w3tc_pgcache_flush')) { w3tc_pgcache_flush(); w3tc_flush_all(); } } add_action( 'publish_post', 'post_delete_cache', 10, 2 );
Can anybody help me? Thank you
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Clean cache automatically when you publish’ is closed to new replies.