| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | <?php /** |
| 2 | 2 | * @version 1.0 |
| 3 | 3 | * @description Ajax and Requests Structure for WPBC_AJX__Setup__Ajax_Request |
| 4 | 4 | * @category Setup Class |
| @@ -366,21 +366,29 @@ | ||
| 366 | 366 | } |
| 367 | 367 | |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | - $setup_steps->db__set_step_as_completed( 'bookings_types' ); | |
| 371 | - if ( ! empty( $cleaned_data ) ) { | |
| 372 | - wpbc_setup_wizard__set_full_screen_mode_for_current_user( true ); | |
| 373 | - $data_arr['current_step'] = wpbc_setup_wizard__get_first_profile_step(); | |
| 374 | - $current_steps_arr = $setup_steps->get_steps_arr(); | |
| 375 | - $setup_steps->db__reset_steps_from( $data_arr['current_step'] ); | |
| 376 | - if ( | |
| 377 | - isset( $current_steps_arr[ $data_arr['current_step'] ] ) | |
| 378 | - && 'manual_save_required' === $setup_steps->get_step_save_behavior( $data_arr['current_step'] ) | |
| 379 | - ) { | |
| 380 | - $setup_steps->db__set_step_as_saved( $data_arr['current_step'], false ); | |
| 381 | - } | |
| 382 | - $data_arr['redirect_url'] = $setup_steps->get_step_target_url( $data_arr['current_step'] ); | |
| 370 | + $setup_steps->db__set_step_as_completed( 'bookings_types' ); | |
| 371 | + if ( ! empty( $cleaned_data ) ) { | |
| 372 | + $data_arr['current_step'] = wpbc_setup_wizard__get_first_profile_step(); | |
| 373 | + $current_steps_arr = $setup_steps->get_steps_arr(); | |
| 374 | + $is_form_builder_handoff = array( 'form_structure' ) === wpbc_setup_wizard__get_profile_route(); | |
| 375 | + | |
| 376 | + if ( $is_form_builder_handoff ) { | |
| 377 | + // Form Builder is the fifth and final temporary Setup step. | |
| 378 | + $setup_steps->db__set_step_as_completed( 'form_structure' ); | |
| 379 | + wpbc_setup_wizard__set_full_screen_mode_for_current_user( false ); | |
| 380 | + } else { | |
| 381 | + wpbc_setup_wizard__set_full_screen_mode_for_current_user( true ); | |
| 382 | + $setup_steps->db__reset_steps_from( $data_arr['current_step'] ); | |
| 383 | + if ( | |
| 384 | + isset( $current_steps_arr[ $data_arr['current_step'] ] ) | |
| 385 | + && 'manual_save_required' === $setup_steps->get_step_save_behavior( $data_arr['current_step'] ) | |
| 386 | + ) { | |
| 387 | + $setup_steps->db__set_step_as_saved( $data_arr['current_step'], false ); | |
| 388 | + } | |
| 389 | + } | |
| 390 | + $data_arr['redirect_url'] = $setup_steps->get_step_target_url( $data_arr['current_step'] ); | |
| 383 | 391 | $data_arr['steps'] = $current_steps_arr; |
| 384 | 392 | $cleaned_request_params['do_action'] = 'redirect_to_setup_step'; |
| 385 | 393 | } |
| 386 | 394 | break; |