Created
December 10, 2021 04:10
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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