Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/post-republisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ public function is_rest_request() {
* @return void
*/
public function republish( WP_Post $post, WP_Post $original_post ) {

\do_action( 'dp_republish_start', $post, $original_post);

// Remove WordPress default filter so a new revision is not created on republish.
\remove_action( 'post_updated', 'wp_save_post_revision', 10 );

Expand All @@ -272,6 +275,8 @@ public function republish( WP_Post $post, WP_Post $original_post ) {

// Re-enable the creation of a new revision.
\add_action( 'post_updated', 'wp_save_post_revision', 10, 1 );

\do_action( 'dp_republish_done', $post, $original_post);
}

/**
Expand Down