diff --git a/.changeset/sweet-gorillas-admire.md b/.changeset/sweet-gorillas-admire.md new file mode 100644 index 000000000..70c5f7069 --- /dev/null +++ b/.changeset/sweet-gorillas-admire.md @@ -0,0 +1,5 @@ +--- +"@headstartwp/headstartwp": patch +--- + +Added - New filter available tenup_headless_wp_revalidate_isr_for_post diff --git a/wp/headless-wp/includes/classes/CacheFlush/CacheFlush.php b/wp/headless-wp/includes/classes/CacheFlush/CacheFlush.php index 36f4a3542..c60d0ea73 100644 --- a/wp/headless-wp/includes/classes/CacheFlush/CacheFlush.php +++ b/wp/headless-wp/includes/classes/CacheFlush/CacheFlush.php @@ -64,6 +64,12 @@ public function trigger_cache_for_post( $post_id, \WP_Post $post, $update ) { return; } + // check if we should revalidate isr for this post particularly + $should_revalidate_isr = apply_filters( 'tenup_headless_wp_revalidate_isr_for_post', true, $post_id, $post ); + if ( ! $should_revalidate_isr ) { + return; + } + /** * Checks whether the revalidation should run in a cron job. *