403 ) ); } wp_safe_redirect( wpbc_get_setup_wizard_page_url() ); exit; } /** * Register the canonical menu through the native Booking Calendar menu system. * * The object is retained for the request because its WordPress callbacks are * instance methods. A stable title replaces the legacy progress-title * generator, and the same entry remains available before and after completion. * * @return void */ function wpbc_setup_wizard_register_menu_controller() { static $menu_controller = null; if ( null !== $menu_controller || ! class_exists( 'WPBC_Admin_Menus' ) || ! WPBC_Setup_Wizard_Access::current_user_can_access() ) { return; } $menu_controller = new WPBC_Admin_Menus( 'wpbc-setup', array( 'in_menu' => 'wpbc', 'menu_title' => __( 'Setup Wizard', 'booking' ), 'page_header' => __( 'Setup Wizard', 'booking' ), 'browser_header' => __( 'Setup Wizard', 'booking' ) . ' - ' . __( 'Booking Calendar', 'booking' ), 'user_role' => get_bk_option( 'booking_user_role_settings' ), ) ); } /** * Attach the page structure after the matching native menu has been created. * * @param string $menu_tag Booking Calendar menu slug that was just created. * * @return void */ function wpbc_setup_wizard_attach_page_controller( $menu_tag ) { static $page_controller = null; if ( 'wpbc-setup' !== $menu_tag || null !== $page_controller ) { return; } $page_controller = new WPBC_Setup_Wizard_Page(); }