w3tc_pgcache_flush_post() function is not working
-
Hi,
I am using the below code to purge the cache after custom post type updated but the function is not working.
add_action( 'save_post', 'my_save_post_function', 10, 3 ); function my_save_post_function( $post_ID, $post, $update ) { global $post_type; if( $post_type == 'articles' ){ //if(function_exists('w3tc_pgcache_flush_post')){ if (w3tc_pgcache_flush_post($post_ID)){ echo __('<div class="udated"><p>Cache Emptied</p></div>'); }else{ echo __('<div class="error"><p>Cache Not Emptied</p></div>'); } } else{ echo __('<div class="error"><p>Not an article</p></div>'); } }When I check
if(function_exists('w3tc_pgcache_flush_post')){it works but when I put the ID w3tc_pgcache_flush_post($post_ID) and tried to flush, it is not working. Can you please help me with the code.Thanks in Advance
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘w3tc_pgcache_flush_post() function is not working’ is closed to new replies.