Description
The action hook gravityflow_workflow_complete fires when the workflow is complete.
Parameters
Parameter | Type | Details |
---|---|---|
$entry_id | Integer | The current entry id |
$form | Form | The current form |
$final_status | String | 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?