gravityflow_send_to_step_condition_met_required

Description

The gravityflow_send_to_step_condition_met_required filter confirms whether the step conditions being met is required to send a workflow to a specific step. It is set to false by default to ensure backwards compatibility to workflow processing prior to Gravity Flow 2.5.10 that introduced the filter.

  • If a (potential) new step does not meet its’ step conditions a message will be logged to the timeline and subsequent steps after the new step will be checked and if valid will be sent to instead.
  • If no steps after the (potential) new step meet their conditions, the entry will remain at the current step.

If you are customizing this filter, you may also want to look at gravityflow_send_to_step_condition_not_met.

Parameters

ParameterTypeDefinition
$conditions_met_requiredBooleanWhether to pass a workflow to a step that has failed its required conditions.
Default set to false.
$new_stepGravity_Flow_StepThe proposed new step.
$current_stepGravity_Flow_StepThe current step.
$entryArrayThe current entry array.
$formArrayThe current form.

Examples

Ensure all API send to step (including admin actions) must meet their step conditions to be sent to.

add_filter( 'gravityflow_send_to_step_condition_met_required', 'jo_send_to_step_condition_not_required', 10, 5 );
function jo_send_to_step_condition_not_required( $conditions_met_required, $new_step, $current_step, $entry, $form ) {
	$conditions_met_required = true;
	return $conditions_met_required;
}

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?