gravityflow_workflow_complete

Description

The action hook gravityflow_workflow_complete fires when the workflow is complete.

Parameters

ParameterTypeDetails
$entry_idInteger The current entry id
$formForm The current form
$final_statusString Final status of the workflow

Examples

Update the final status to ‘complete’ from ‘approved’ for Form #31

add_action( 'gravityflow_workflow_complete', 'workflow_finish_complete_status', 5, 3 );
function workflow_finish_complete_status( $entry_id, $form, $final_status ) {
	if ( $form['id'] == '31' ) {
		if ( $final_status == 'approved' ) {
			gform_update_meta( $entry_id, 'workflow_final_status', 'complete' );
			gravity_flow()->log_debug( __METHOD__ . '(): Final Status cycled to complete (from approved)' );
		}
	}
}

Placement

This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.

See also the PHP section in this article: Where Do I Put This Code?