PluginProbe
Booking Calendar / 11.8.3
Booking Calendar v11.8.3
11.8.3 11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 10.11 10.11.2 All 203 releases
← All changes | includes/page-setup/setup__page.php +237 -81 10.1011.8.3 View file →
@@ -1,4 +1,4 @@
1 1 <?php
2 2 /*
3 3 * @package: AJX_Setup_Wizard Page
4 4 * @category: Initial setup and plugin customization
@@ -9,41 +9,15 @@
9 9 // FixIn: 10.2.0.1.
10 10 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
11 11
12 12 /**
13 - * == How to add a new step ? ==
14 - *
15 - * 1. Create and include (bellow) a new files:
16 - * require_once( WPBC_PLUGIN_DIR . '/includes/page-setup/templates/form_structure__tpl.php' );
17 - * require_once( WPBC_PLUGIN_DIR . '/includes/page-setup/templates/form_structure__action.php' );
18 - *
19 - * 2) ../includes/page-setup/setup_steps.php
20 - * - Add a new step structure in init_steps_data()
21 - *
22 - * 3)../includes/page-setup/setup_ajax.php
23 - * - Add validation option 'save_and_continue__form_structure' in wpbc_setup_wizard_page__request_rules_structure()
24 - * - Add save action in ajax_WPBC_AJX_SETUP_WIZARD_PAGE :
25 - * case 'save_and_continue__form_structure': $
26 - * if ( isset( $_POST['all_ajx_params']['step_data'] ) && ( ! empty( $_POST['all_ajx_params']['step_data'] ) ) ) {
27 - * $cleaned_data = wpbc_template__form_structure__action_validate_data( $_POST['all_ajx_params']['step_data'] );
28 - * wpbc_setup__update__form_structure( $cleaned_data );
29 - * }
30 - * $setup_steps->db__set_step_as_completed( 'form_structure' );
31 - * break;
32 - * - Optional. Add loading booking form:
33 - * switch ( $cleaned_request_params['current_step'] ) {
34 - * case 'form_structure':
35 - * 4) ../includes/page-setup/setup_templates.php
36 - * - Add loading template in function wpbc_template__stp_wiz__main_content() {
37 - * case 'form_structure':
38 - * template__main_section = wp.template( 'wpbc_stp_wiz__template__form_structure' );
39 - * break;
40 - * - include template in function hook__load_templates_at_footer( $page ):
41 - * wpbc_stp_wiz__template__form_structure();
13 + * The setup wizard renders only the introductory steps on this page. Profile-specific configuration after
14 + * "Booking Type" is routed to existing WPBC admin pages and controlled by the floating setup bar.
42 15 */
43 16
44 17
45 18 require_once( WPBC_PLUGIN_DIR . '/includes/page-setup/setup_templates.php' );
19 +require_once( WPBC_PLUGIN_DIR . '/includes/page-setup/setup_profiles.php' );
46 20 require_once( WPBC_PLUGIN_DIR . '/includes/page-setup/templates/01.welcome__tpl.php' );
47 21
48 22 require_once( WPBC_PLUGIN_DIR . '/includes/page-setup/templates/02.general_info__tpl.php' );
49 23 require_once( WPBC_PLUGIN_DIR . '/includes/page-setup/templates/02.general_info__action.php' );
@@ -53,29 +27,12 @@
53 27
54 28 require_once( WPBC_PLUGIN_DIR . '/includes/page-setup/templates/04.bookings_types__tpl.php' );
55 29 require_once( WPBC_PLUGIN_DIR . '/includes/page-setup/templates/04.bookings_types__action.php' );
56 30
57 -require_once( WPBC_PLUGIN_DIR . '/includes/page-setup/templates/05.form_structure__tpl.php' );
58 -require_once( WPBC_PLUGIN_DIR . '/includes/page-setup/templates/05.form_structure__action.php' );
59 -
60 -require_once( WPBC_PLUGIN_DIR . '/includes/page-setup/templates/06.cal_availability__tpl.php' );
61 -require_once( WPBC_PLUGIN_DIR . '/includes/page-setup/templates/06.cal_availability__action.php' );
62 -
63 -require_once( WPBC_PLUGIN_DIR . '/includes/page-setup/templates/07.color_theme__tpl.php' );
64 -require_once( WPBC_PLUGIN_DIR . '/includes/page-setup/templates/07.color_theme__action.php' );
65 -
66 -require_once( WPBC_PLUGIN_DIR . '/includes/page-setup/templates/08.optional_other_settings__tpl.php' );
67 -require_once( WPBC_PLUGIN_DIR . '/includes/page-setup/templates/08.optional_other_settings__action.php' );
68 -
69 -require_once( WPBC_PLUGIN_DIR . '/includes/page-setup/templates/09.wizard_publish__tpl.php' );
70 -require_once( WPBC_PLUGIN_DIR . '/includes/page-setup/templates/09.wizard_publish__action.php' );
71 -
72 -require_once( WPBC_PLUGIN_DIR . '/includes/page-setup/templates/10.get_started__tpl.php' );
73 -require_once( WPBC_PLUGIN_DIR . '/includes/page-setup/templates/10.get_started__action.php' );
74 -
75 31 require_once( WPBC_PLUGIN_DIR . '/includes/page-setup/setup_steps.php' );
76 -require_once( WPBC_PLUGIN_DIR . '/includes/page-setup/setup_ajax.php' );
77 -require_once( WPBC_PLUGIN_DIR . '/includes/page-setup/setup_support.php' );
32 +require_once( WPBC_PLUGIN_DIR . '/includes/page-setup/setup_ajax.php' );
33 +require_once( WPBC_PLUGIN_DIR . '/includes/page-setup/setup_support.php' );
34 +require_once( WPBC_PLUGIN_DIR . '/includes/page-setup/first-run-popup.php' );
78 35
79 36 /** Show Content
80 37 * Update Content
81 38 * Define Slug
@@ -89,10 +46,8 @@
89 46
90 47 parent::__construct();
91 48
92 49 add_filter( 'admin_body_class', array( $this, 'add_loading_classes' ) );
93 -
94 - // add_action( 'wpbc_page_show_left_navigation_custom', array( $this, 'left_navigation_custom__settings_all' ) );
95 50 }
96 51
97 52
98 53 public function in_page() {
@@ -103,11 +58,14 @@
103 58 public function tabs() {
104 59
105 60 $tabs = array();
106 61 $tabs[ 'step_01' ] = array(
62 + 'is_force_full_screen' => true, // true | false. Force full screen independently from user preference.
63 + 'left_navigation__default_view_mode' => 'none', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''.
64 + 'left_navigation__force_view_mode' => 'none', // '' | 'min' | 'compact' | 'max' | 'none'. Force sidebar mode independently from user preference.
107 65 'title' => __( 'Setup', 'booking' ) // Title of TAB
108 - , 'hint' => __( 'Setup', 'booking' ) . ' - ' . 'Booking Calendar' // Hint
109 - , 'page_title' => __( 'Setup', 'booking' ) . ' - ' . 'Booking Calendar' // Title of Page
66 + , 'hint' => false//__( 'Setup', 'booking' ) . ' - ' . 'Booking Calendar' // Hint
67 + , 'page_title' => false//__( 'Setup', 'booking' ) . ' - ' . 'Booking Calendar' // Title of Page
110 68 , 'link' => '' // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link
111 69 , 'position' => '' // 'left' || 'right' || ''
112 70 , 'css_classes' => '' // CSS class(es)
113 71 , 'icon' => '' // Icon - link to the real PNG img
@@ -121,23 +79,19 @@
121 79 $subtabs = array();
122 80 $subtabs['path_setup'] = array(
123 81 'type' => 'subtab' // Required| Possible values: 'subtab' | 'separator' | 'button' | 'goto-link' | 'html'
124 82 , 'title' => __( 'Setup', 'booking' ) // Title of TAB
125 - , 'page_title'=> __( 'Setup', 'booking' ) . ' - ' . 'Booking Calendar' // Title of Page
126 - , 'hint' => __( 'Setup', 'booking' ) . ' - ' . 'Booking Calendar' // Hint
83 + , 'page_title'=> false//__( 'Setup', 'booking' ) . ' - ' . 'Booking Calendar' // Title of Page
84 + , 'hint' => false//__( 'Setup', 'booking' ) . ' - ' . 'Booking Calendar' // Hint
127 85 , 'link' => '#path_setup' // link
128 86 , 'position' => '' // 'left' || 'right' || ''
129 87 , 'css_classes' => '' // CSS class(es)
130 88 //, 'icon' => 'http://.../icon.png' // Icon - link to the real PNG img
131 89 //, 'font_icon' => 'wpbc_icn_mail_outline' // CSS definition of Font Icon
132 - , 'header_font_icon' => 'wpbc_icn_donut_large' // CSS definition of Font Icon // FixIn: 9.6.1.4.
133 - , 'default' => true // Is this sub tab activated by default or not: true || false.
90 + , 'default' => true // Is this sub tab activated by default or not: true || false.
134 91 , 'disabled' => false // Is this sub tab deactivated: true || false.
135 92 , 'checkbox' => false // or definition array for specific checkbox: array( 'checked' => true, 'name' => 'feature1_active_status' ) //, 'checkbox' => array( 'checked' => $is_checked, 'name' => 'enabled_active_status' )
136 93 , 'content' => 'content' // Function to load as content of this TAB
137 - //, 'is_use_left_navigation' => true // == Show $tabs[ 'step_01' ]['title'] -> "Setup" Menu at left side instead of Old top menu (which is hidden in setup_page.css .wpbc_top_tabs_sub_menu{...}, in case if we do not use navigation path, e.g. $tabs[ 'step_01' ]['subtabs']['path_setup'][ 'is_use_navigation_path'] = false;
138 - //, 'is_use_left_navigation_custom' => true // == Usually used Together with 'is_use_left_navigation': true, and defined CUSTOM left menu, instead of submenu. Need to use add_action( 'wpbc_page_show_left_navigation_custom', array( $this, 'left_navigation_custom__settings_all' ) ); in constructor and custom func: left_navigation_custom__settings_all
139 - , 'show_checked_icon' => false
140 94 , 'is_use_navigation_path' => array(
141 95 'path' => array(
142 96 'go_back_to_dashboard' => array(
143 97 'title' => __('Go to Dashboard','booking'),
@@ -271,9 +225,15 @@
271 225
272 226 ?><script type="text/javascript"><?php
273 227 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
274 228 echo wpbc_jq_ready_start();
229 + if( $this->is_full_screen ) {
275 230 ?>
231 + jQuery( '.wpbc_ui__top_nav__btn_full_screen,.wpbc_ui__top_nav__btn_normal_screen' ).toggleClass( 'wpbc_ui__hide' );
232 + wpbc_check_full_screen_mode();
233 + <?php
234 + }
235 + ?>
276 236
277 237 // Set Security - Nonce for Ajax - Listing
278 238 _wpbc_settings.set_param__secure( 'nonce', '<?php echo esc_js( wp_create_nonce( 'wpbc_setup_wizard_page_ajx' . '_wpbcnonce' ) ); ?>' );
279 239 _wpbc_settings.set_param__secure( 'user_id', '<?php echo esc_js( wpbc_get_current_user_id() ); ?>' );
@@ -283,10 +243,9 @@
283 243 _wpbc_settings.set_param__other( 'container__main_content', '.wpbc_setup_wizard_page_container' );
284 244
285 245 // Send Ajax and then show content
286 246 wpbc_ajx__setup_wizard_page__send_request_with_params( <?php echo wp_json_encode( $escaped_request_params_arr ); ?> );
287 -
288 - <?php
247 + <?php
289 248 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
290 249 echo wpbc_jq_ready_end();
291 250 ?></script><?php
292 251
@@ -291,9 +250,9 @@
291 250 ?></script><?php
292 251
293 252 /**
294 253 * JS Examples of showing specific Step:
295 - * wpbc_ajx__setup_wizard_page__send_request_with_params( { 'current_step':'optional_other_settings' } );
254 + * wpbc_ajx__setup_wizard_page__send_request_with_params( { 'current_step':'date_availability' } );
296 255 *
297 256 * wpbc_ajx__setup_wizard_page__send_request_with_params( { 'current_step':'general_info' } );
298 257 */
299 258 }
@@ -312,23 +271,8 @@
312 271 }
313 272
314 273 return $classes;
315 274 }
316 -
317 -
318 - /**
319 - * Show custom tabs for Toolbar at . - . R i g h t . s i d e.
320 - *
321 - * @param string $menu_in_page_tag - active page
322 - *
323 - public function left_navigation_custom__settings_all( $menu_in_page_tag ) {
324 -
325 - if ( $this->in_page() == $menu_in_page_tag ) {
326 -
327 - wpbc_page_show_left_navigation_custom__settings_all();
328 - }
329 - }
330 - */
331 275 }
332 276 add_action('wpbc_menu_created', array( new WPBC_Page_AJX_Setup_Wizard() , '__construct') ); // Executed after creation of Menu
333 277
334 278
@@ -344,8 +288,9 @@
344 288 if ( isset( $_REQUEST['wpbc_setup_wizard'] ) && 'completed' === $_REQUEST['wpbc_setup_wizard'] ) {
345 289
346 290 $setup_steps = new WPBC_SETUP_WIZARD_STEPS();
347 291 $setup_steps->db__set_all_steps_as( true );
292 + wpbc_setup_wizard__set_full_screen_mode_for_current_user( false );
348 293
349 294 return true;
350 295 }
351 296
@@ -365,13 +310,224 @@
365 310 // Delete from DB
366 311 $is_reseted = $user_request->user_request_params__db_delete();
367 312
368 313 // Clear All Steps Mark as Undone
369 - $setup_steps = new WPBC_SETUP_WIZARD_STEPS();
370 - $setup_steps->db__set_all_steps_as( false );
314 + $setup_steps = new WPBC_SETUP_WIZARD_STEPS();
315 + $setup_steps->db__set_all_steps_as( false );
316 + update_bk_option( 'booking_wizard_data', array() );
317 + wpbc_setup_wizard__set_full_screen_mode_for_current_user( true );
371 318
372 319 return true;
373 320 }
374 321
322 + $setup_steps = new WPBC_SETUP_WIZARD_STEPS();
323 + $steps_arr = $setup_steps->get_steps_arr();
324 + $request_step = '';
325 +
326 + if ( 'On' === get_bk_option( 'booking_setup_wizard_page_is_completed' ) ) {
327 + // A completed wizard has no authority over the administrator's later Full Screen preference.
328 + return true;
329 + }
330 +
331 + if ( wpbc_is_setup_wizard_page() ) {
332 + wpbc_setup_wizard__set_full_screen_mode_for_current_user( true );
333 + }
334 +
335 + $is_external_setup_flow_started = $setup_steps->db__is_step_completed( 'bookings_types' );
336 +
337 + // Persist the real setup step when the user lands on an external WPBC admin page.
338 + // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
339 + if ( isset( $_REQUEST['wpbc_setup_step'] ) ) {
340 + // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
341 + $request_step_from_request = sanitize_key( wp_unslash( $_REQUEST['wpbc_setup_step'] ) );
342 + if ( isset( $steps_arr[ $request_step_from_request ] ) ) {
343 + $request_step = $request_step_from_request;
344 + $setup_steps->db__save_current_step_name( $request_step );
345 + wpbc_setup_wizard__set_full_screen_mode_for_current_user( ( ! wpbc_setup_wizard__is_internal_step( $request_step ) ) && ( 'get_started' !== $request_step ) );
346 + }
347 + }
348 +
349 + if ( $is_external_setup_flow_started && function_exists( 'wpbc_setup_wizard__detect_step_from_admin_request' ) ) {
350 + $detected_step = wpbc_setup_wizard__detect_step_from_admin_request();
351 + if ( empty( $request_step ) && ! empty( $detected_step ) && isset( $steps_arr[ $detected_step ] ) ) {
352 + $setup_steps->db__save_current_step_name( $detected_step );
353 + wpbc_setup_wizard__set_full_screen_mode_for_current_user( ! wpbc_setup_wizard__is_internal_step( $detected_step ) );
354 + }
355 + }
356 +
357 + $is_ajax_request = ( function_exists( 'wp_doing_ajax' ) && wp_doing_ajax() ) || ( defined( 'DOING_AJAX' ) && DOING_AJAX );
358 +
359 + // Existing settings pages submit their own forms. This flag lets the setup bar remember that save across reloads.
360 + // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
361 + if ( isset( $_REQUEST['wpbc_setup_saved_step'] ) && ! $is_ajax_request ) {
362 + // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
363 + $saved_step = sanitize_key( wp_unslash( $_REQUEST['wpbc_setup_saved_step'] ) );
364 + if ( isset( $steps_arr[ $saved_step ] ) ) {
365 + $setup_steps->db__set_step_as_saved( $saved_step, true );
366 + $setup_steps->db__save_current_step_name( $saved_step );
367 +
368 + // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
369 + $continue_after_save = isset( $_REQUEST['wpbc_setup_continue_after_save'] )
370 + // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
371 + ? sanitize_text_field( wp_unslash( $_REQUEST['wpbc_setup_continue_after_save'] ) )
372 + : '';
373 + if ( '1' === $continue_after_save ) {
374 + wpbc_redirect( $setup_steps->get_step_continue_url( $saved_step ) );
375 + exit;
376 + }
377 + }
378 + }
379 +
380 + // Continue from an existing WPBC settings page to the next setup target.
381 + // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
382 + if ( isset( $_REQUEST['wpbc_setup_wizard'] ) && 'continue' === $_REQUEST['wpbc_setup_wizard'] ) {
383 +
384 + // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
385 + $nonce = isset( $_REQUEST['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) : '';
386 + if ( ! wp_verify_nonce( $nonce, 'wpbc_settings_url_nonce' ) ) {
387 + return false;
388 + }
389 +
390 + $setup_steps = new WPBC_SETUP_WIZARD_STEPS();
391 + $steps_arr = $setup_steps->get_steps_arr();
392 + $current_step = $setup_steps->get_saved_current_step_name();
393 + $has_explicit_step_context = false;
394 +
395 + // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
396 + if ( isset( $_REQUEST['wpbc_setup_step'] ) ) {
397 + // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
398 + $request_step = sanitize_key( wp_unslash( $_REQUEST['wpbc_setup_step'] ) );
399 + if ( isset( $steps_arr[ $request_step ] ) ) {
400 + $current_step = $request_step;
401 + $has_explicit_step_context = true;
402 + }
403 + }
404 +
405 + // Prefer the step detected on the page that rendered the setup bar. This avoids stale saved state taking over.
406 + // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
407 + if ( isset( $_REQUEST['wpbc_setup_from_page_step'] ) ) {
408 + // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
409 + $from_page_step = sanitize_key( wp_unslash( $_REQUEST['wpbc_setup_from_page_step'] ) );
410 + if ( isset( $steps_arr[ $from_page_step ] ) ) {
411 + $current_step = $from_page_step;
412 + $has_explicit_step_context = true;
413 + if ( 'form_structure' === $current_step ) {
414 + $setup_steps->db__set_step_as_saved( $current_step, true );
415 + }
416 + }
417 + }
418 +
419 + if ( ( ! $has_explicit_step_context ) && function_exists( 'wpbc_setup_wizard__detect_step_from_admin_url' ) ) {
420 + $referer_step = wpbc_setup_wizard__detect_step_from_admin_url( wp_get_referer() );
421 + if ( ! empty( $referer_step ) && isset( $steps_arr[ $referer_step ] ) ) {
422 + $current_step = $referer_step;
423 + if ( 'form_structure' === $current_step ) {
424 + $setup_steps->db__set_step_as_saved( $current_step, true );
425 + }
426 + }
427 + }
428 +
429 + $setup_steps->db__save_current_step_name( $current_step );
430 +
431 + if (
432 + isset( $steps_arr[ $current_step ] )
433 + && 'manual_save_required' === $setup_steps->get_step_save_behavior( $current_step )
434 + && ! $setup_steps->db__is_step_saved( $current_step )
435 + ) {
436 + wpbc_redirect( add_query_arg( 'wpbc_setup_save_required', '1', $setup_steps->get_step_target_url( $current_step ) ) );
437 + exit;
438 + }
439 +
440 + if ( isset( $steps_arr[ $current_step ] ) ) {
441 + $setup_steps->db__set_step_as_completed( $current_step );
442 + }
443 +
444 + $next_step = isset( $steps_arr[ $current_step ]['next'] ) ? $steps_arr[ $current_step ]['next'] : '';
445 + if ( ( empty( $next_step ) || ( 'welcome' === $next_step ) ) && function_exists( 'wpbc_setup_wizard__get_next_step_name' ) ) {
446 + $route_next_step = wpbc_setup_wizard__get_next_step_name( $current_step );
447 + if ( ! empty( $route_next_step ) && isset( $steps_arr[ $route_next_step ] ) ) {
448 + $next_step = $route_next_step;
449 + }
450 + }
451 +
452 + if ( empty( $next_step ) || ( 'welcome' === $next_step ) ) {
453 + if ( 'get_started' === $current_step || 'complete' === $setup_steps->get_step_save_behavior( $current_step ) ) {
454 + $setup_steps->db__set_all_steps_as( true );
455 + wpbc_setup_wizard__set_full_screen_mode_for_current_user( false );
456 + wpbc_redirect( wpbc_get_bookings_url() );
457 + exit;
458 + }
459 +
460 + if ( 'get_started' !== $current_step ) {
461 + $fallback_step = $setup_steps->get_active_step_name();
462 + if (
463 + ( ! empty( $fallback_step ) )
464 + && isset( $steps_arr[ $fallback_step ] )
465 + && ( $fallback_step !== $current_step )
466 + && ! $setup_steps->db__is_step_completed( $fallback_step )
467 + ) {
468 + $setup_steps->db__save_current_step_name( $fallback_step );
469 + wpbc_redirect( $setup_steps->get_step_target_url( $fallback_step ) );
470 + exit;
471 + }
472 + }
473 +
474 + wpbc_setup_wizard__set_full_screen_mode_for_current_user( false );
475 + wpbc_redirect( wpbc_get_bookings_url() );
476 + exit;
477 + }
478 +
479 + $setup_steps->db__reset_steps_from( $next_step );
480 +
481 + $request_params_to_save = wpbc_setup_wizard_page__get_cleaned_params__saved_request_default();
482 + if ( ! is_array( $request_params_to_save ) ) {
483 + $request_params_to_save = wpbc_setup_wizard_page__get__request_values__default();
484 + }
485 + $request_params_to_save['current_step'] = $next_step;
486 + if (
487 + isset( $steps_arr[ $next_step ] )
488 + && 'manual_save_required' === $setup_steps->get_step_save_behavior( $next_step )
489 + && ! $setup_steps->db__is_step_completed( $next_step )
490 + ) {
491 + $setup_steps->db__set_step_as_saved( $next_step, false );
492 + }
493 +
494 + $user_request = new WPBC_AJX__REQUEST( array(
495 + 'db_option_name' => 'booking_setup_wizard_page_request_params',
496 + 'user_id' => wpbc_get_current_user_id(),
497 + 'request_rules_structure' => wpbc_setup_wizard_page__request_rules_structure()
498 + )
499 + );
500 + $user_request->user_request_params__db_save( $request_params_to_save );
501 +
502 + wpbc_redirect( $setup_steps->get_step_target_url( $next_step ) );
503 + exit;
504 + }
505 +
506 + // In the guided setup architecture, Step 5+ is configured on existing WPBC admin pages.
507 + if (
508 + wpbc_is_setup_wizard_page()
509 + && ( ! ( function_exists( 'wp_doing_ajax' ) && wp_doing_ajax() ) )
510 + ) {
511 + $current_step = $setup_steps->get_saved_current_step_name();
512 +
513 + // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
514 + if ( isset( $_REQUEST['current_step'] ) ) {
515 + // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
516 + $request_step = sanitize_key( wp_unslash( $_REQUEST['current_step'] ) );
517 + if ( isset( $steps_arr[ $request_step ] ) ) {
518 + $current_step = $request_step;
519 + }
520 + }
521 +
522 + if (
523 + isset( $steps_arr[ $current_step ]['is_external'] )
524 + && $steps_arr[ $current_step ]['is_external']
525 + ) {
526 + wpbc_redirect( $setup_steps->get_step_target_url( $current_step ) );
527 + exit;
528 + }
529 + }
530 +
375 531 return false;
376 532 }
377 -add_action( 'init', 'wpbc_setup_wizard_page__force_in_get' );
533 +add_action( 'init', 'wpbc_setup_wizard_page__force_in_get' );