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_steps.php +33 -10 11.6.111.8.3 View file →
@@ -1,4 +1,4 @@
1 1 <?php /**
2 2 * @version 1.0
3 3 * @description Steps Structure for Setup Wizard Page
4 4 * @category Setup Class
@@ -41,12 +41,31 @@
41 41 * Whether the setup bar has already been printed in the current request.
42 42 *
43 43 * @var bool
44 44 */
45 - private static $is_top_bar_rendered = false;
45 + private static $is_top_bar_rendered = false;
46 +
47 + /**
48 + * Check whether the legacy floating Setup Wizard bar is enabled.
49 + *
50 + * The bar is temporarily disabled while the initial Setup Wizard hands the
51 + * user directly to Form Builder. The filter preserves a bounded rollback
52 + * path without changing Setup Wizard progress or stored configuration.
53 + *
54 + * @return bool True when the floating Setup Wizard bar may be registered.
55 + */
56 + private static function is_floating_setup_bar_enabled() {
57 +
58 + /**
59 + * Filter whether the legacy floating Setup Wizard bar is enabled.
60 + *
61 + * @param bool $is_enabled Whether the floating Setup Wizard bar is enabled.
62 + */
63 + return (bool) apply_filters( 'wpbc_setup_wizard_floating_bar_enabled', false );
64 + }
65 +
66 + public function __construct() {
46 67
47 - public function __construct() {
48 -
49 68 if ( WPBC()->is_wp_inited() || did_action( 'init' ) ) {
50 69 $this->init_steps_data();
51 70 } else {
52 71 add_action( 'init', array( $this, 'init_steps_data' ) );
@@ -51,12 +70,12 @@
51 70 } else {
52 71 add_action( 'init', array( $this, 'init_steps_data' ) );
53 72 }
54 73
55 - if ( ! self::$is_top_bar_hook_registered ) {
56 - add_action( 'wpbc_after_wpbc_page_top__header_tabs', array( $this, 'show_top_right_wizard_button' ), 10, 3 );
57 - self::$is_top_bar_hook_registered = true;
58 - }
74 + if ( self::is_floating_setup_bar_enabled() && ! self::$is_top_bar_hook_registered ) {
75 + add_action( 'wpbc_after_wpbc_page_top__header_tabs', array( $this, 'show_top_right_wizard_button' ), 10, 3 );
76 + self::$is_top_bar_hook_registered = true;
77 + }
59 78
60 79 }
61 80
62 81 /**
@@ -812,11 +831,15 @@
812 831 *
813 832 * Show Continue Setup Wizard Button
814 833 * @return void
815 834 */
816 - public function show_top_right_wizard_button() {
817 -
818 - if ( ! wpbc_is_setup_wizard_page() ) {
835 + public function show_top_right_wizard_button() {
836 +
837 + if ( ! self::is_floating_setup_bar_enabled() ) {
838 + return false;
839 + }
840 +
841 + if ( ! wpbc_is_setup_wizard_page() ) {
819 842 $explicit_step_context = false;
820 843
821 844 // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only Setup Wizard routing context.
822 845 if ( isset( $_GET['wpbc_setup_step'] ) && is_scalar( $_GET['wpbc_setup_step'] ) ) {