gravityflow_post_status_update_approval

Description

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

Parameters

ParameterTypeDetails
$entryEntryThe current entry array.
$assigneeAssigneeThe assignee object.
$new_statusStringThe new status.
$formFormThe current form array.

Examples

Check if ‘revert’ is used and add ‘Reverting’ to Gravity Flow logs

add_action( 'gravityflow_post_status_update_approval', 'sh_gravityflow_post_status_update_approval', 10, 4 );
function sh_gravityflow_post_status_update_approval( $entry, $assignee, $new_status, $form ) {
   if ( $new_status == 'revert' ) {
      gravity_flow()->log_debug( 'Reverting' );
   }
}

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?