gravityflow_workflow_complete
Fires when the workflow is complete.
add_action('gravityflow_workflow_complete', 'my_workflow_complete_function', 10, 3); function my_workflow_complete_function( $entry_id, $form, $final_status ) { if ( $form['id'] == 123 ) { // Replace your Form ID // do stuff } }
The follow example will 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 should be placed in the functions.php file of your active theme.