Description
The gravityflow_approval_assignee_status_feedback
filter allows you to modify the feedback message displayed when an assignee updates their status in a Gravity Flow approval step.
This can be useful to customize the feedback message based on a unique status type, defined in gravityflow_approval_assignee_status_types, before an approval decision (approved/rejected) status update is made. This is similar to how revert status is handled when a user input step is associated to the step.
Parameters
Parameter | Type | Details |
---|---|---|
$status_feedback | bool | string | The status feedback for the assignee process. |
$assignee | Gravity_Flow_Assignee | The assignee object. |
$new_status | string | The new status. |
$form | array | The current form array. |
$step | Gravity_Flow_Step | The current step. |
Examples
Customizing Assignee Status Feedback for a custom step status
add_filter( 'gravityflow_approval_assignee_status_feedback', array( $this, 'jo_feedback_process'), 10, 5 );
function jo_feedback_process( $feedback, $assignee, $new_status, $form, $current_step ) {
if ( $new_status != 'archived' ) {
return false;
}
//Do any custom logic related to a custom assignee status defined in gravityflow_approval_assignee_status_types
$feedback = $current_step->get_name() . ': Archival of entry before approval decision was made';
return $feedback;
}
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?
Since
This filter was added in Gravity Flow 2.9.8.
Source Code
This filter is located in includes/steps/class-step-approval.php