gravityflow_above_approval_buttons

Description

The gravityflow_above_approval_buttons action allows custom buttons or information to be presented to the assignee directly above the approve/revert/reject buttons on the entry details page.

Parameters

ParameterTypeDetails
$current_stepStepSpecifies the current step that the entry is on in its workflow.
$formFormThe form from which the entry was submitted.

Examples

Add a custom button

In order for this button to change the entry status from pending, you would also need to make customizations to gravityflow_approval_assignee_status_type to define the new status (review) and gravityflow_approval_assignee_status_feedback for how it would process that status.

add_action( 'gravityflow_above_approval_buttons', 'approval_review_fields_button' , 10, 2 );
function approval_review_fields_button( $current_step, $form ) {
	if ( $current_step->get_type() == 'approval' ) :
		?>
		<div class="gravityflow-action-buttons">
			<button name="gravityflow_approval_new_status_step_<?php echo $current_step->get_id(); ?>" value="review" type="submit" class="button" style="min-width: 245px; margin-bottom: 3px;">
			<?php
				$review_label = esc_html__( 'Review', 'gravityflow' );
				$review_icon = '<i class="fa fa-pencil" style="color: blue;"></i>';
				echo $review_icon . ' ' . $review_label;
			?>
			</button>
		</div>
		<?php
	endif;
}

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?