normalize_legacy_settings_request(); if ( ! wpbc_is_mu_user_can_be_here( 'only_super_admin' ) ) { // If this User not "super admin", then do not load this page at all // If tab was not selected or selected default, then redirect it to the "form" tab. // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing if ( ( isset( $_REQUEST['page'] ) && ( 'wpbc-settings' === $_REQUEST['page'] ) ) && ( ( ! isset( $_REQUEST['tab'] ) ) || ( 'general' === $_REQUEST['tab'] ) ) ) { $_REQUEST['tab'] = 'form'; } } else { parent::__construct(); } } /** * Route settings links for sections that were moved into the Advanced group. * * Existing bookmarks and integrations can continue using the former Admin * Panel group and the previous Manage Bookings location of the front-end * Timeline settings. Subtab identifiers remain unchanged. * * @return void */ private function normalize_legacy_settings_request() { $request_page = isset( $_REQUEST['page'] ) && is_scalar( $_REQUEST['page'] ) ? sanitize_key( (string) wp_unslash( $_REQUEST['page'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended $request_tab = isset( $_REQUEST['tab'] ) && is_scalar( $_REQUEST['tab'] ) ? sanitize_key( (string) wp_unslash( $_REQUEST['tab'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended $request_subtab = isset( $_REQUEST['subtab'] ) && is_scalar( $_REQUEST['subtab'] ) ? sanitize_key( (string) wp_unslash( $_REQUEST['subtab'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended $is_legacy_admin_panel = 'admin_panel' === $request_tab; $is_legacy_timeline = 'manage_bookings' === $request_tab && 'booking_timeline' === $request_subtab; if ( 'wpbc-settings' !== $request_page || ( ! $is_legacy_admin_panel && ! $is_legacy_timeline ) ) { return; } $_REQUEST['tab'] = 'advanced'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( isset( $_GET['tab'] ) ) { $_GET['tab'] = 'advanced'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended } } public function in_page() { if ( ! wpbc_is_mu_user_can_be_here( 'only_super_admin' ) ) { // If this User not "super admin", then do not load this page at all. return (string) wp_rand( 100000, 1000000 ); } return 'wpbc-settings'; } /** * Get Settings API class - define, show, update "Fields". * * @return object Settings API */ public function settings_api() { if ( false === $this->settings_api ) { $this->settings_api = new WPBC_Settings_API_General(); } return $this->settings_api; } public function tabs() { // Init vars. $separator_i = 0; $tabs = array(); $subtab_default = array( 'type' => 'subtab', // Required| Possible values: 'subtab' | 'separator' | 'button' | 'goto-link' | 'html'. 'title' => '', 'page_title' => '', 'hint' => '', 'link' => '', 'css_classes' => '', 'font_icon' => 'wpbc_icn_dashboard', 'font_icon_right' => 'wpbc-bi-question-circle', 'default' => false, ); // ============================================================================================================= // == D A S H B O A R D == // ============================================================================================================= $tabs['general'] = array( 'is_show_top_path' => true, // true | false. By default value is: false. 'is_show_top_navigation' => false, // true | false. By default value is: false. 'left_navigation__default_view_mode' => '', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''. 'page_title' => __( 'General Settings', 'booking' ), // Header - Title. If false, than hidden. // translators: 1: Booking Calendar. 'page_description' => sprintf( __( 'Configure various options and settings in the %s.', 'booking' ), 'Booking Calendar' ), 'title' => __( 'Dashboard', 'booking' ), // Left Vertical Menu - Title. // translators: 1: Booking Calendar. 'hint' => sprintf( __( 'Configure various options and settings in the %s.', 'booking' ), 'Booking Calendar' ), 'link' => '', // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link. 'default' => true, // Is this tab activated by default or not: true / false. 'font_icon' => 'wpbc-bi-speedometer2', // 'font_icon_right' => 'wpbc-bi-question-circle', 'css_classes' => 'do_expand__' . 'wpbc_general_settings_dashboard_metabox' . '_link', 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . 'wpbc_general_settings_dashboard_metabox' . "' );", 'folder_style' => 'order:10;', ); // FixIn: 10.12.4.7. $tabs[ 'settings' . ( ++$separator_i ) ] = array_merge( $subtab_default, array( 'type' => 'separator' ,'folder_style' => 'order:10;' ) ); // ============================================================================================================= // == C O N F I R M A T I ON == // ============================================================================================================= $tabs['booking_confirmation'] = array( 'is_show_top_path' => true, // true | false. By default value is: true. 'is_show_top_navigation' => false, // true | false. By default value is: false. 'left_navigation__default_view_mode' => '', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''. 'page_title' => __( 'General Settings', 'booking' ), // Header - Title. If false, than hidden. // translators: 1: Booking Calendar. 'page_description' => sprintf( __( 'Configure various options and settings in the %s.', 'booking' ), 'Booking Calendar' ), 'title' => __( 'Booking Confirmation', 'booking' ), // Left Vertical Menu - Title. 'hint' => __( 'Customize how the booking summary is displayed after a booking is created', 'booking' ), 'link' => '', // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link. 'default' => false, // Is this tab activated by default or not: true / false. 'font_icon' => 'wpbc-bi-card-checklist', 'font_icon_right' => 'wpbc-bi-question-circle', 'css_classes' => 'do_expand__' . 'wpbc_general_settings_booking_confirmation_metabox' . '_link', 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . 'wpbc_general_settings_booking_confirmation_metabox#wpbc_general_settings_booking_confirmation_left_metabox#wpbc_general_settings_booking_confirmation_right_metabox#wpbc_general_settings_booking_confirmation_help_metabox' . "' );", 'folder_style' => 'order:20;', ); // FixIn: 10.12.4.7. $tabs[ 'settings' . ( ++$separator_i ) ] = array_merge( $subtab_default, array( 'type' => 'separator' ,'folder_style' => 'order:20;' ) ); // ============================================================================================================= // == Manage Bookings == // ============================================================================================================= $tabs['manage_bookings'] = array( 'is_show_top_path' => true, // true | false. By default value is: true. 'is_show_top_navigation' => false, // true | false. By default value is: false. 'left_navigation__default_view_mode' => '', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''. 'page_title' => __( 'General Settings', 'booking' ), // Header - Title. If false, than hidden. // translators: 1: Booking Calendar. 'page_description' => sprintf( __( 'Configure various options and settings in the %s.', 'booking' ), 'Booking Calendar' ), 'title' => __( 'Manage Bookings', 'booking' ), // Left Vertical Menu - Title. // translators: 1: Booking Calendar. 'hint' => sprintf( __( 'Configure various options and settings in the %s.', 'booking' ), 'Booking Calendar' ), 'font_icon' => 'wpbc_icn_app_registration', // Left Vertical Menu - Icon. 'link' => '', // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link. 'css_classes' => '', // CSS. 'icon' => '', // Icon - link to the real PNG img. 'default' => false, // Is this tab activated by default or not: true / false. 'folder_style' => 'order:1000', ); $subtabs = array(); $section_id = 'wpbc_general_settings_booking_timeline_metabox'; $booking_timeline_subtab = array_merge( $subtab_default, array( 'title' => __( 'Timeline (front-end)', 'booking' ), 'page_title' => __( 'General Settings', 'booking' ), 'hint' => __( 'Customize timeline options, including the display of booking details.', 'booking' ), 'font_icon' => 'wpbc_icn_align_vertical_bottom wpbc_icn_rotate_90', 'font_icon_right' => 'wpbc-bi-question-circle', 'css_classes' => 'do_expand__' . $section_id . '_link ', 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );", 'default' => false, ) ); if ( class_exists('wpdev_bk_personal') ) { $section_id = 'wpbc_general_settings_bookings_options_metabox'; $subtabs['bookings_options'] = array_merge( $subtab_default, array( 'title' => __( 'Manage Bookings', 'booking' ), 'page_title' => __( 'General Settings', 'booking' ), 'hint' => __( 'Allow customers to edit or cancel their own bookings.', 'booking' ), 'font_icon' => 'wpbc_icn_app_registration mode_edit_outline edit_calendar', 'font_icon_right' => 'wpbc-bi-question-circle', 'css_classes' => 'do_expand__' . $section_id . '_link ', 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );", 'default' => false, ) ); } if ( class_exists('wpdev_bk_biz_s') ) { $section_id = 'wpbc_general_settings_auto_cancelation_approval_metabox'; $subtabs['auto_cancelation_approval'] = array_merge( $subtab_default, array( 'title' => __( 'Auto Cancellation / Auto Approval', 'booking' ), 'page_title' => __( 'General Settings', 'booking' ), 'hint' => __( 'Enable automatic approval or cancellation of bookings.', 'booking' ), 'font_icon' => 'wpbc_icn_published_with_changes', 'font_icon_right' => 'wpbc-bi-question-circle', 'css_classes' => 'do_expand__' . $section_id . '_link', 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );", 'default' => false, ) ); } $tabs['manage_bookings']['subtabs'] = $subtabs; // ============================================================================================================= // == Admin Panel == // ============================================================================================================= $tabs['admin_panel'] = array( 'is_show_top_path' => true, // true | false. By default value is: true. 'is_show_top_navigation' => false, // true | false. By default value is: false. 'left_navigation__default_view_mode' => '', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''. 'page_title' => __( 'General Settings', 'booking' ), // Header - Title. If false, than hidden. 'page_description' => __( 'Configure various options and settings in the admin panel.', 'booking' ), // Header - Title Description. If false, than hidden. 'title' => __( 'Admin Panel', 'booking' ), // Left Vertical Menu - Title. // translators: 1: Booking Calendar. 'hint' => sprintf( __( 'Configure various options and settings in the %s.', 'booking' ), 'Booking Calendar' ), 'font_icon' => 'wpbc_icn_widgets', // Left Vertical Menu - Icon. 'link' => '', // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link. 'css_classes' => '', // CSS. 'icon' => '', // Icon - link to the real PNG img. 'default' => false, // Is this tab activated by default or not: true / false. 'folder_style' => 'order:1000', ); $subtabs = array(); $section_id = 'wpbc_general_settings_booking_listing_metabox'; $subtabs['booking_listing'] = array_merge( $subtab_default, array( 'title' => __( 'Booking Admin Panel', 'booking' ), 'page_title' => __( 'General Settings', 'booking' ), 'hint' => __( 'Configure various options and settings in the admin panel.', 'booking' ), 'font_icon' => 'wpbc-bi-list', 'font_icon_right' => 'wpbc-bi-question-circle', 'css_classes' => 'do_expand__' . $section_id . '_link', 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );", 'default' => false, ) ); $section_id = 'wpbc_general_settings_booking_calendar_overview_metabox'; $subtabs['booking_calendar_overview'] = array_merge( $subtab_default, array( 'title' => __( 'Timeline View (Back-End)', 'booking' ), 'page_title' => __( 'General Settings', 'booking' ), 'hint' => __( 'Customize timeline options in the admin panel, including displaying booking details.', 'booking' ), 'font_icon' => 'wpbc-bi-bar-chart-steps _icn_timeline 0wpbc_icn_rotate_45 0wpbc_icn_align_vertical_bottom', 'font_icon_right' => 'wpbc-bi-question-circle', 'css_classes' => 'do_expand__' . $section_id . '_link', 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );", 'default' => false, ) ); $subtabs['booking_timeline'] = $booking_timeline_subtab; $section_id = 'wpbc_general_settings_datestimes_metabox'; $subtabs['datestimes'] = array_merge( $subtab_default, array( 'title' => __( 'Date and Time Formats', 'booking' ), 'page_title' => __( 'General Settings', 'booking' ), 'hint' => __( 'Customize the display format for dates and times.', 'booking' ), 'font_icon' => 'wpbc-bi-braces-asterisk _icn_password', 'font_icon_right' => 'wpbc-bi-question-circle', 'css_classes' => 'do_expand__' . $section_id . '_link', 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );", 'default' => false, ) ); $section_id = 'wpbc_general_settings_permissions_metabox'; $subtabs['permissions'] = array_merge( $subtab_default, array( 'title' => __( 'Plugin Menu / Permissions', 'booking' ), 'page_title' => __( 'General Settings', 'booking' ), 'hint' => __( 'Set user permissions for accessing plugin menu pages and configure the menu position.', 'booking' ), 'font_icon' => 'wpbc-bi-key', 'font_icon_right' => 'wpbc-bi-question-circle', 'css_classes' => 'do_expand__' . $section_id . '_link', 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );", 'default' => false, ) ); $section_id = 'wpbc_general_settings_translations_metabox'; $subtabs['translations'] = array_merge( $subtab_default, array( 'title' => __( 'Translations', 'booking' ), 'page_title' => __( 'General Settings', 'booking' ), 'hint' => __( 'Choose whether to use local translations or WordPress translations.', 'booking' ), 'font_icon' => 'wpbc_icn_translate 0wpbc-bi-translate', 'font_icon_right' => 'wpbc-bi-question-circle', 'css_classes' => 'do_expand__' . $section_id . '_link', 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );", 'default' => false, ) ); $tabs['admin_panel']['subtabs'] = $subtabs; $admin_panel_subtabs = $subtabs; unset( $tabs['admin_panel'] ); // ============================================================================================================= // == Advanced == // ============================================================================================================= $tabs['advanced'] = array( 'is_show_top_path' => true, // true | false. By default value is: true. 'is_show_top_navigation' => false, // true | false. By default value is: false. 'left_navigation__default_view_mode' => '', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''. 'page_title' => __( 'General Settings', 'booking' ), // Header - Title. If false, than hidden. // translators: 1: Booking Calendar. 'page_description' => sprintf( __( 'Configure various options and settings in the %s.', 'booking' ), 'Booking Calendar' ), 'title' => __( 'Advanced', 'booking' ), // Left Vertical Menu - Title. // translators: 1: Booking Calendar. 'hint' => sprintf( __( 'Configure various options and settings in the %s.', 'booking' ), 'Booking Calendar' ), 'font_icon' => 'wpbc-bi-gear', // Left Vertical Menu - Icon. 'link' => '', // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link. 'css_classes' => '', // CSS. 'icon' => '', // Icon - link to the real PNG img. 'default' => false, // Is this tab activated by default or not: true / false. 'folder_style' => 'order:1000', ); $subtabs = array(); $section_id = 'wpbc_general_settings_advanced_metabox'; $subtabs['advanced_options'] = array_merge( $subtab_default, array( 'title' => __( 'Advanced Options', 'booking' ), 'page_title' => __( 'General Settings', 'booking' ), 'hint' => __( 'Configure loading of CSS/JavaScript files, set the number of simultaneous requests, and other advanced options.', 'booking' ), 'font_icon' => 'wpbc_icn_adjust', 'font_icon_right' => 'wpbc-bi-question-circle', 'css_classes' => 'do_expand__' . $section_id . '_link', 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );", 'default' => false, ) ); $section_id = 'wpbc_general_settings_uninstall_metabox'; $subtabs['uninstall'] = array_merge( $subtab_default, array( 'title' => __( 'Uninstall / Deactivation', 'booking' ), 'page_title' => __( 'General Settings', 'booking' ), 'hint' => __( 'Enable the option to fully erase booking data when the plugin is deactivated.', 'booking' ), 'font_icon' => 'wpbc-bi-trash', 'font_icon_right' => 'wpbc-bi-question-circle', 'css_classes' => 'do_expand__' . $section_id . '_link', 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );", 'default' => false, ) ); $section_id = 'wpbc_general_settings_information_metabox'; $subtabs['information'] = array_merge( $subtab_default, array( 'title' => __( 'Plugin Info & News', 'booking' ), 'page_title' => __( 'General Settings', 'booking' ), 'hint' => __( 'Stay informed with the latest news and details about the plugin.', 'booking' ), 'font_icon' => 'wpbc_icn_newspaper -bi-newspaper _icn_news 0wpbc-bi-translate', 'font_icon_right' => 'wpbc-bi-question-circle', 'css_classes' => 'do_expand__' . $section_id . '_link', 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );", 'default' => false, ) ); $section_id = 'wpbc_general_settings_help_metabox'; $subtabs['tools'] = array_merge( $subtab_default, array( 'title' => __( 'Tools', 'booking' ), 'page_title' => __( 'General Settings', 'booking' ), 'hint' => '', //__( 'Stay informed with the latest news and details about the plugin. ', 'booking' ), 'font_icon' => 'wpbc_icn_construction', 'font_icon_right' => '', 'css_classes' => 'do_expand__' . $section_id . '_link', 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );", 'default' => false, ) ); $tabs['advanced']['subtabs'] = array_merge( $admin_panel_subtabs, $subtabs ); // FixIn: 10.12.4.7. $tabs[ 'settings' . ( ++$separator_i ) ] = array_merge( $subtab_default, array( 'type' => 'separator' ,'folder_style' => 'order:900;' ) ); // $tabs[ 'settings' . ( ++$separator_i ) ] = array_merge( $subtab_default, array( 'type' => 'separator' ,'folder_style' => 'order:1000;' ) ); return $tabs; } public function content() { // Checking. do_action( 'wpbc_hook_settings_page_header', 'general_settings' ); // Define Notices Section and show some static messages, if needed. if ( ! wpbc_is_mu_user_can_be_here( 'activated_user' ) ) { return false; } // Check if MU user activated, otherwise show Warning message. if ( ! wpbc_is_mu_user_can_be_here( 'only_super_admin' ) ) { return false; } // User is not Super admin, so exit. Basically its was already checked at the bottom of the PHP file, just in case. // Redirect legacy Settings > Calendar links to the dedicated Calendar settings page. // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing if ( ! empty( $_GET['scroll_to_section'] ) ) { $scroll_to_section = sanitize_text_field( wp_unslash( $_GET['scroll_to_section'] ) ); if ( 'wpbc_general_settings_calendar_tab' === $scroll_to_section ) { wpbc_redirect( function_exists( 'wpbc_settings_calendar__get_section_url' ) ? wpbc_settings_calendar__get_section_url( 'general' ) : admin_url( 'admin.php?page=wpbc-settings&tab=calendar_settings' ) ); return; } if ( 'wpbc_general_settings_days_tooltips_tab' === $scroll_to_section ) { wpbc_redirect( function_exists( 'wpbc_settings_calendar__get_section_url' ) ? wpbc_settings_calendar__get_section_url( 'tooltips' ) : admin_url( 'admin.php?page=wpbc-settings&tab=calendar_settings&wpbc_calendar_section=tooltips' ) ); return; } if ( 'wpbc_general_settings_availability_tab' === $scroll_to_section ) { wpbc_redirect( function_exists( 'wpbc_get_general_availability_url' ) ? wpbc_get_general_availability_url() : admin_url( 'admin.php?page=wpbc-availability&tab=general_availability' ) ); return; } } $is_can = apply_bk_filter( 'recheck_version', true ); if ( ! $is_can ) { ?> settings_api(); // Define all fields and get values from DB. // Submit . $submit_form_name = 'wpbc_general_settings_form'; // Define form name. // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing if ( isset( $_POST[ 'is_form_sbmitted_' . $submit_form_name ] ) ) { // Nonce checking {Return false if invalid, 1 if generated between, 0-12 hours ago, 2 if generated between 12-24 hours ago. }. $nonce_gen_time = check_admin_referer( 'wpbc_settings_page_' . $submit_form_name ); // Its stop show anything on submiting, if its not refear to the original page. // Save Changes . $this->update(); } // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing if ( ! empty( $_GET['scroll_to_section'] ) ) { ?>
Redirect after 1 second...
'; wpbc_js_for_bookings_page(); echo ''; // TODO: 2025-05-05 update in real top path. wpbc_ui_settings__top_path(); // Content . ?>
true, 'is_show_minimize' => false ) ); ?>
false, 'is_show_minimize' => false ) ); $this->settings_api()->show( 'booking_confirmation' ); wpbc_close_meta_box_section(); ?>
false, 'is_show_minimize' => false ) ); $this->settings_api()->show( 'booking_confirmation_left' ); wpbc_close_meta_box_section(); wpbc_open_meta_box_section( 'wpbc_general_settings_booking_confirmation_right', __( 'Section', 'booking' ) . ': ' . __( 'Booking details', 'booking' ), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); $this->settings_api()->show( 'booking_confirmation_right' ); wpbc_close_meta_box_section(); ?>
false, 'is_show_minimize' => false ) ); $this->settings_api()->show( 'booking_confirmation_help' ); wpbc_close_meta_box_section(); ?>
false, 'is_show_minimize' => false ) ); ?> settings_api()->show( 'bookings_options' ); ?> false, 'is_show_minimize' => false ) ); ?> settings_api()->show( 'booking_listing' ); ?> false, 'is_show_minimize' => false ) ); ?> settings_api()->show( 'booking_calendar_overview' ); ?> false, 'is_show_minimize' => false ) ); ?> settings_api()->show( 'booking_timeline' ); ?> false, 'is_show_minimize' => false ) ); ?> settings_api()->show( 'auto_cancelation_approval' ); ?> false, 'is_show_minimize' => false ) ); ?> settings_api()->show( 'advanced' ); ?> false, 'is_show_minimize' => false ) ); ?> settings_api()->show( 'information' ); ?> false, 'is_show_minimize' => false ) ); ?> settings_api()->show( 'date_time' ); ?> false, 'is_show_minimize' => false ) ); ?> settings_api()->show( 'permissions' ); ?> false, 'is_show_minimize' => false ) ); ?> settings_api()->show( 'uninstall' ); ?> false, 'is_show_minimize' => false ) ); ?> settings_api()->show( 'help' ); ?> false, 'is_show_minimize' => false ) ); ?> settings_api()->show( 'translations' ); ?>
' . esc_html__( 'Update Translations', 'booking' ) . ''; } } if ( ! wpbc_is_this_demo() ) { echo '' . esc_html__( 'Restore all dismissed windows', 'booking' ) . ''; } ?>
settings_api()->validate_post(); // Get Validated Settings fields in $_POST request. $validated_fields = apply_filters( 'wpbc_settings_validate_fields_before_saving', $validated_fields ); // Hook for validated fields. foreach ( $this->settings_api()->get_form_fields() as $field_name => $field ) { if ( ! empty( $field['group'] ) && in_array( $field['group'], array( 'calendar', 'days_tooltips', 'availability' ), true ) ) { unset( $validated_fields[ $field_name ] ); } } /** * Skip saving specific option, for example in Demo mode. * // unset( $validated_fields['booking_start_day_weeek'] ); */ // FixIn: 9.8.6.1. // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing if ( ! empty( $_POST['form_visible_section'] ) ) { ?> settings_api()->save_to_db( $validated_fields ); // Save fields to DB. wpbc_show_changes_saved_message(); /** * // O L D W A Y: Saving Fields Data * // update_bk_option( 'booking_is_delete_if_deactive' * // , WPBC_Settings_API::validate_checkbox_post('booking_is_delete_if_deactive') ); * // ( (isset( $_POST['booking_is_delete_if_deactive'] ))?'On':'Off') ); */ } } /** * if ( ! wpbc_is_mu_user_can_be_here( 'only_super_admin' ) ) { // If this User not "super admin", then do not load this page at all if ( ( ! isset( $ _GET['tab'] ) ) || ( $_GET['tab'] == 'general' ) ) { // If tab was not selected or selected default, then redirect it to the "form" tab. $_GET['tab'] = 'form'; } } else { add_action('wpbc_menu_created', array( new WPBC_Page_SettingsGeneral() , '__construct') ); // Executed after creation of Menu } */ add_action('wpbc_menu_created', array( new WPBC_Page_SettingsGeneral() , '__construct') ); // Executed after creation of Menu