gravityflow_post_status_update_approval

The gravityflow_post_status_update_approval action allows the user to perform custom actions after the Approval workflow step status has been processed.

Parameters

$entry Array - The current entry array.
$assignee Gravity_Flow_Assignee - The assignee object.

$new_status String - The new status.
$form Array - The current form array.

Example

The following snippet will check if 'revert' is used and add 'Reverting' to logs.

add_action( 'gravityflow_post_status_update_approval', 'sh_gravityflow_post_status_update_approval', 10, 4 );
/**
 * @param array $entry
 * @param Gravity_Flow_Assignee $assignee
 * @param string $new_status
 * @param array $form
 */
function sh_gravityflow_post_status_update_approval( $entry, $assignee, $new_status, $form ) {
   if ( $new_status == 'revert' ) {
      gravity_flow()->log_debug( 'Reverting' );
   }
}

Placement

This code should be placed in the functions.php file of your active theme or in a custom functions plugin.