Disable purge cache using filters
-
Hello
How to disable purge the cache using filters?I try to use the next code, but it doesn’t work
add_action('save_post', 'disable_purge_cloudflare_on_draft', 5, 3); function disable_purge_cloudflare_on_draft( $post_ID, $post, $update ) { $update_post_disable_flush = array( 'draft', 'pending', 'private', 'auto-draft', 'draft', ); if (class_exists('SiteGround_Optimizer\Supercacher\Supercacher')) { $class = new SiteGround_Optimizer\Supercacher\Supercacher_Posts(); foreach ( SiteGround_Optimizer\Supercacher\Supercacher::get_instance()->purge_hooks as $hook ) { remove_action( $hook, array( SiteGround_Optimizer\Supercacher\Supercacher::get_instance(), 'purge_everything' ) ); remove_action( $hook, array( SiteGround_Optimizer\Supercacher\Supercacher::get_instance(), 'flush_memcache' ) ); remove_action( $hook, array( $class, 'purge_all_post_cache' ) ); } } } add_action('save_post_form-entries', 'disable_purge_cloudflare', 10, 3); add_action('save_post_blocks', 'disable_purge_cloudflare', 10, 3); function disable_purge_cloudflare( $post_ID, $post, $update ) { if (class_exists('SiteGround_Optimizer\Supercacher\Supercacher')) { $class = new SiteGround_Optimizer\Supercacher\Supercacher_Posts(); foreach ( SiteGround_Optimizer\Supercacher\Supercacher::get_instance()->purge_hooks as $hook ) { remove_action( $hook, array( SiteGround_Optimizer\Supercacher\Supercacher::get_instance(), 'purge_everything' ) ); remove_action( $hook, array( SiteGround_Optimizer\Supercacher\Supercacher::get_instance(), 'flush_memcache' ) ); remove_action( $hook, array( $class, 'purge_all_post_cache' ) ); } } }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Disable purge cache using filters’ is closed to new replies.