diff --git a/includes/Cache.php b/includes/Cache.php index 323b3e5e8055ff1ee871aa965e969092276d35f9..429347b712f541c664830aa070fb489de2eab595 100644 --- a/includes/Cache.php +++ b/includes/Cache.php @@ -31,12 +31,17 @@ class Cache { $this->setCacheFiles(); + if (apply_filters('rrzecache_skip_cache', false)) { + Flush::flushCache(); + return; + } + add_action('init', [$this, 'add_publish_hooks'], 99); add_action('pre_comment_approved', [$this, 'pre_comment_approved'], 99, 2); add_action('transition_comment_status', [$this, 'transition_comment_status'], 10, 3); add_action('edit_comment', [$this, 'edit_comment']); add_action('post_submitbox_misc_actions', [$this, 'post_cache_submitbox'], 99); - add_action('template_redirect', [$this, 'template_redirect'], 0); + add_action('template_redirect', [$this, 'template_redirect'], 1); add_action('rrzecache_flush_cache_post_id', [__NAMESPACE__ . '\Flush', 'flushCacheByPostId']); add_action('rrzecache_flush_cache_url', [__NAMESPACE__ . '\Flush', 'flushCacheByUrl']); @@ -185,7 +190,7 @@ class Cache -