Skip to content

Commit d0cd0c1

Browse files
authored
gpeb-restart-workflow-on-edit.php: Added new snippet.
1 parent ded71e0 commit d0cd0c1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
/**
3+
* Gravity Perks // Entry Blocks // Restart Workflow on Entry Edit
4+
* https://gravitywiz.com/documentation/gravity-forms-entry-blocks/
5+
*/
6+
// Update "123" with your form ID.
7+
add_filter( 'gform_entry_created_123', function( $entry, $form) {
8+
if ( class_exists( 'Gravity_Flow_API' )
9+
&& is_callable( 'gp_entry_blocks' )
10+
&& gp_entry_blocks()->block_edit_form->has_submitted_edited_entry()
11+
) {
12+
$api = new Gravity_Flow_API($form['id'] );
13+
$api->restart_workflow( $entry );
14+
}
15+
}, 10, 2 );

0 commit comments

Comments
 (0)