Skip to content

Commit

Permalink
Feature/add revalidate isr for post filter (#660)
Browse files Browse the repository at this point in the history
Co-authored-by: Nícholas André <[email protected]>
Co-authored-by: Nícholas André <[email protected]>
  • Loading branch information
3 people authored Dec 22, 2023
1 parent ddd728d commit 18d0938
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/sweet-gorillas-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@headstartwp/headstartwp": patch
---

Added - New filter available tenup_headless_wp_revalidate_isr_for_post
6 changes: 6 additions & 0 deletions wp/headless-wp/includes/classes/CacheFlush/CacheFlush.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

1 comment on commit 18d0938

@vercel
Copy link

@vercel vercel bot commented on 18d0938 Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.