Skip to content

Commit

Permalink
Merge pull request #18 from Dexerto/prevent-duplicate-revalidations
Browse files Browse the repository at this point in the history
Prevent duplicate revalidations
  • Loading branch information
dorumrr authored Jun 27, 2024
2 parents 8e0b9fc + 04bfa9c commit 3810b8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Feel free to create a PR to [plugin Github repo](https://github.com/Dexerto/on-d


== Changelog ==
= 1.2.5 =
- feat: prevent revalidate functions from running more than once within a single save_post request from @MuhammedAO
= 1.2.4 =
- fix: do not send non-replaced string if term is not there
= 1.2.3 =
Expand Down
4 changes: 4 additions & 0 deletions src/Revalidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ public static function handle_save_post( $post_id, $post ) {
if ( false !== wp_is_post_revision( $post_id ) ) {
return;
}

if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
return;
}

self::revalidate_post( $post );
}
Expand Down

0 comments on commit 3810b8b

Please sign in to comment.