Fix process navigation

This commit is contained in:
Almira Krdzic
2018-12-02 10:59:32 +01:00
parent 71d615907d
commit 3dfe06bc76

View File

@@ -4,6 +4,8 @@ if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$is_step_completed = $current_step->get_status() === 'complete' || $current_step->get_status() === 'approved';
// get next step id
$next_step = gravity_flow()->get_next_step($current_step, $current_step->get_entry(), $current_step->get_form());
$next_step_id = empty($next_step) ? null : $next_step->get_id();
@@ -19,7 +21,7 @@ foreach ($steps as $step) {
$previous_step_id = empty($previous_step) ? null : $previous_step->get_id();
// bail out if none exist
if ( empty($next_step_id) && empty($previous_step_id) ) {
if ( empty($next_step_id) && empty($previous_step_id) && $is_step_completed) {
return;
}