settings_api ) { $this->settings_api = new WPBC_Settings_API_General(); } return $this->settings_api; } public function tabs() { $tabs = array(); $tabs['general'] = array( 'title' => __( 'General', 'booking' ), // Title of TAB. 'page_title' => __( 'General Settings', 'booking' ), // Title of Page. 'hint' => __( 'General Settings', 'booking' ), // Hint. 'link' => '', // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link. 'position' => '', // 'left' / 'right' / ''. 'css_classes' => '', // CSS. 'icon' => '', // Icon - link to the real PNG img. 'font_icon' => 'wpbc_icn_tune', // CSS definition of forn Icon. 'default' => true // Is this tab activated by default or not: true / false. ); $subtabs = array(); $tabs['general']['subtabs'] = $subtabs; 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. $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 ''; wpbc_ui_settings__top_path(); // Content . ?>
true, 'is_show_minimize' => false ) ); ?>
false, 'is_show_minimize' => false ) ); ?> settings_api()->show( 'calendar' ); ?> false, 'is_show_minimize' => false ) ); ?> settings_api()->show( 'days_tooltips' ); ?> false, 'is_show_minimize' => false ) ); ?> settings_api()->show( 'time_slots' ); ?> false, 'is_show_minimize' => false ) ); ?> settings_api()->show( 'availability' ); ?> false, 'is_show_minimize' => false ) ); ?> settings_api()->show( 'form' ); ?> 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( 'capacity' ); ?> ' ', 'hint' => __( 'Dismiss', 'booking' ), 'class' => 'wpbc_panel_get_started_dismiss', 'css' => 'background: #fff;border-radius: 7px;' )); ?> false, 'is_show_minimize' => false, 'dismiss_button' => $dismiss_button_content ) ); $this->settings_api()->show( 'capacity_upgrade' ); wpbc_close_meta_box_section(); } } ?> 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' ); ?> false, 'is_show_minimize' => false ) ); ?> settings_api()->show( 'multiuser' ); ?>
' . 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. /** * 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