Restart Workflow on Entry Edit

Code

Filename: gpeb-restart-workflow-on-edit.php

<?php
/**
 * Gravity Perks // Entry Blocks // Restart Workflow on Entry Edit
 * https://gravitywiz.com/documentation/gravity-forms-entry-blocks/
 */
add_filter( 'gform_entry_created', function( $entry, $form ) {
	// Update "123" with your form ID.
	if (
		$form['id'] == 123
		&& class_exists( 'Gravity_Flow_API' )
		&& is_callable( 'gp_entry_blocks' )
		&& gp_entry_blocks()->block_edit_form->has_submitted_edited_entry()
	) {
		$api = new Gravity_Flow_API( $form['id'] );
		$api->restart_workflow( $entry );
	}
}, 10, 2 );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.