Skip to content

Instantly share code, notes, and snippets.

@zackkatz
Created December 10, 2021 04:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zackkatz/41cd19feb0d74e91d4953be523ee2e4b to your computer and use it in GitHub Desktop.
Save zackkatz/41cd19feb0d74e91d4953be523ee2e4b to your computer and use it in GitHub Desktop.
GravityView - Reset all Gravity Flow workflow statuses for a duplicated entry after duplicating
<?php
/**
* Reset all Gravity Flow workflow statuses for a duplicated entry after duplicating in GravityView.
*
* @param array $duplicated_entry The duplicated entry
*/
add_action( 'gravityview/duplicate-entry/duplicated', function( $duplicated_entry ) {
if ( ! class_exists( 'Gravity_Flow_API' ) ) {
return;
}
$Gravity_Flow_API = new Gravity_Flow_API( $duplicated_entry['form_id'] );
$Gravity_Flow_API->restart_workflow( $duplicated_entry );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment