Created
February 5, 2018 11:37
-
-
Save Idealien/1569cb052c9e1573bb8be401fb1afb76 to your computer and use it in GitHub Desktop.
Gravity Flow - Conclude Workflow as Complete
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
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' ) { | |
$entry = GFAPI::get_entry( $entry_id ); | |
if ( $entry ) { | |
$entry['workflow_final_status'] = 'complete'; | |
$result = GFAPI::update_entry( $entry ); | |
gravity_flow()->log_debug( __METHOD__ . '(): Final Status cycled to complete (from approved)' ); | |
} | |
} | |
} | |
} | |
%> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment