PluginProbe
Booking Calendar / 11.3
Booking Calendar v11.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
booking / core / admin / page-settings.php

page-settings.php in Booking Calendar 11.3, at core/admin/page-settings.php

934 lines 49.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php /**
2 * @version 1.0
3 * @package Booking Calendar
4 * @category Content of Settings page
5 * @author wpdevelop
6 *
7 * @web-site https://wpbookingcalendar.com/
8 * @email info@wpbookingcalendar.com
9 *
10 * @modified 2015-11-02
11 */
12
13 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
14
15
16 /**
17 * Show Content
18 * Update Content
19 * Define Slug
20 * Define where to show
21 */
22 class WPBC_Page_SettingsGeneral extends WPBC_Page_Structure {
23
24 /**
25 * Link to Settings API obj
26 *
27 * @var bool
28 */
29 private $settings_api = false;
30
31 public function __construct() {
32
33 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
34 // If tab was not selected or selected default, then redirect it to the "form" tab.
35 // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
36 if ( ( isset( $_REQUEST['page'] ) && ( 'wpbc-settings' === $_REQUEST['page'] ) ) && ( ( ! isset( $_REQUEST['tab'] ) ) || ( 'general' === $_REQUEST['tab'] ) ) ) {
37 $_REQUEST['tab'] = 'form';
38 }
39 } else {
40 parent::__construct();
41 }
42 }
43
44 public function in_page() {
45
46 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.
47 return (string) wp_rand( 100000, 1000000 );
48 }
49
50 return 'wpbc-settings';
51 }
52
53
54 /**
55 * Get Settings API class - define, show, update "Fields".
56 *
57 * @return object Settings API
58 */
59 public function settings_api() {
60
61 if ( false === $this->settings_api ) {
62 $this->settings_api = new WPBC_Settings_API_General();
63 }
64
65 return $this->settings_api;
66 }
67
68
69 public function tabs() {
70
71 // Init vars.
72 $separator_i = 0;
73 $tabs = array();
74 $subtab_default = array(
75 'type' => 'subtab', // Required| Possible values: 'subtab' | 'separator' | 'button' | 'goto-link' | 'html'.
76 'title' => '',
77 'page_title' => '',
78 'hint' => '',
79 'link' => '',
80 'css_classes' => '',
81 'font_icon' => 'wpbc_icn_dashboard',
82 'font_icon_right' => 'wpbc-bi-question-circle',
83 'default' => false,
84 );
85
86 // =============================================================================================================
87 // == D A S H B O A R D ==
88 // =============================================================================================================
89 $tabs['general'] = array(
90 'is_show_top_path' => true, // true | false. By default value is: false.
91 'is_show_top_navigation' => false, // true | false. By default value is: false.
92 'left_navigation__default_view_mode' => '', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''.
93 'page_title' => __( 'General Settings', 'booking' ), // Header - Title. If false, than hidden.
94 // translators: 1: Booking Calendar.
95 'page_description' => sprintf( __( 'Configure various options and settings in the %s.', 'booking' ), 'Booking Calendar' ),
96 'title' => __( 'Dashboard', 'booking' ), // Left Vertical Menu - Title.
97 // translators: 1: Booking Calendar.
98 'hint' => sprintf( __( 'Configure various options and settings in the %s.', 'booking' ), 'Booking Calendar' ),
99 'link' => '', // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link.
100 'default' => true, // Is this tab activated by default or not: true / false.
101 'font_icon' => 'wpbc-bi-speedometer2',
102 // 'font_icon_right' => 'wpbc-bi-question-circle',
103 'css_classes' => 'do_expand__' . 'wpbc_general_settings_dashboard_metabox' . '_link',
104 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . 'wpbc_general_settings_dashboard_metabox' . "' );",
105 'folder_style' => 'order:10;',
106 );
107 // FixIn: 10.12.4.7. $tabs[ 'settings' . ( ++$separator_i ) ] = array_merge( $subtab_default, array( 'type' => 'separator' ,'folder_style' => 'order:10;' ) );
108
109
110 // =============================================================================================================
111 // == C O N F I R M A T I ON ==
112 // =============================================================================================================
113 $tabs['booking_confirmation'] = array(
114 'is_show_top_path' => true, // true | false. By default value is: true.
115 'is_show_top_navigation' => false, // true | false. By default value is: false.
116 'left_navigation__default_view_mode' => '', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''.
117 'page_title' => __( 'General Settings', 'booking' ), // Header - Title. If false, than hidden.
118 // translators: 1: Booking Calendar.
119 'page_description' => sprintf( __( 'Configure various options and settings in the %s.', 'booking' ), 'Booking Calendar' ),
120 'title' => __( 'Booking Confirmation', 'booking' ), // Left Vertical Menu - Title.
121 'hint' => __( 'Customize how the booking summary is displayed after a booking is created', 'booking' ),
122 'link' => '', // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link.
123 'default' => false, // Is this tab activated by default or not: true / false.
124 'font_icon' => 'wpbc-bi-card-checklist',
125 'font_icon_right' => 'wpbc-bi-question-circle',
126 'css_classes' => 'do_expand__' . 'wpbc_general_settings_booking_confirmation_metabox' . '_link',
127 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" .
128 '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' .
129 "' );",
130 'folder_style' => 'order:20;',
131 );
132
133 // FixIn: 10.12.4.7. $tabs[ 'settings' . ( ++$separator_i ) ] = array_merge( $subtab_default, array( 'type' => 'separator' ,'folder_style' => 'order:20;' ) );
134
135 // =============================================================================================================
136 // == Manage Bookings ==
137 // =============================================================================================================
138 $tabs['manage_bookings'] = array(
139 'is_show_top_path' => true, // true | false. By default value is: true.
140 'is_show_top_navigation' => false, // true | false. By default value is: false.
141 'left_navigation__default_view_mode' => '', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''.
142 'page_title' => __( 'General Settings', 'booking' ), // Header - Title. If false, than hidden.
143 // translators: 1: Booking Calendar.
144 'page_description' => sprintf( __( 'Configure various options and settings in the %s.', 'booking' ), 'Booking Calendar' ),
145 'title' => __( 'Manage Bookings', 'booking' ), // Left Vertical Menu - Title.
146 // translators: 1: Booking Calendar.
147 'hint' => sprintf( __( 'Configure various options and settings in the %s.', 'booking' ), 'Booking Calendar' ),
148 'font_icon' => 'wpbc_icn_app_registration', // Left Vertical Menu - Icon.
149 'link' => '', // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link.
150 'css_classes' => '', // CSS.
151 'icon' => '', // Icon - link to the real PNG img.
152 'default' => false, // Is this tab activated by default or not: true / false.
153 'folder_style' => 'order:1000',
154 );
155
156 $subtabs = array();
157
158 $section_id = 'wpbc_general_settings_booking_timeline_metabox';
159 $subtabs['booking_timeline'] = array_merge(
160 $subtab_default,
161 array(
162 'title' => __( 'Timeline (front-end)', 'booking' ),
163 'page_title' => __( 'General Settings', 'booking' ),
164 'hint' => __( 'Customize timeline options, including the display of booking details.', 'booking' ),
165 'font_icon' => 'wpbc_icn_align_vertical_bottom wpbc_icn_rotate_90',
166 'font_icon_right' => 'wpbc-bi-question-circle',
167 'css_classes' => 'do_expand__' . $section_id . '_link ',
168 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
169 'default' => false,
170 )
171 );
172
173 if ( class_exists('wpdev_bk_personal') ) {
174 $section_id = 'wpbc_general_settings_bookings_options_metabox';
175 $subtabs['bookings_options'] = array_merge(
176 $subtab_default,
177 array(
178 'title' => __( 'Manage Bookings', 'booking' ),
179 'page_title' => __( 'General Settings', 'booking' ),
180 'hint' => __( 'Allow customers to edit or cancel their own bookings.', 'booking' ),
181 'font_icon' => 'wpbc_icn_app_registration mode_edit_outline edit_calendar',
182 'font_icon_right' => 'wpbc-bi-question-circle',
183 'css_classes' => 'do_expand__' . $section_id . '_link ',
184 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
185 'default' => false,
186 )
187 );
188 }
189
190
191 if ( class_exists('wpdev_bk_biz_s') ) {
192 $section_id = 'wpbc_general_settings_auto_cancelation_approval_metabox';
193 $subtabs['auto_cancelation_approval'] = array_merge(
194 $subtab_default,
195 array(
196 'title' => __( 'Auto Cancellation / Auto Approval', 'booking' ),
197 'page_title' => __( 'General Settings', 'booking' ),
198 'hint' => __( 'Enable automatic approval or cancellation of bookings.', 'booking' ),
199 'font_icon' => 'wpbc_icn_published_with_changes',
200 'font_icon_right' => 'wpbc-bi-question-circle',
201 'css_classes' => 'do_expand__' . $section_id . '_link',
202 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
203 'default' => false,
204 )
205 );
206 }
207
208 $tabs['manage_bookings']['subtabs'] = $subtabs;
209
210
211 // =============================================================================================================
212 // == Admin Panel ==
213 // =============================================================================================================
214 $tabs['admin_panel'] = array(
215 'is_show_top_path' => true, // true | false. By default value is: true.
216 'is_show_top_navigation' => false, // true | false. By default value is: false.
217 'left_navigation__default_view_mode' => '', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''.
218 'page_title' => __( 'General Settings', 'booking' ), // Header - Title. If false, than hidden.
219 'page_description' => __( 'Configure various options and settings in the admin panel.', 'booking' ), // Header - Title Description. If false, than hidden.
220 'title' => __( 'Admin Panel', 'booking' ), // Left Vertical Menu - Title.
221 // translators: 1: Booking Calendar.
222 'hint' => sprintf( __( 'Configure various options and settings in the %s.', 'booking' ), 'Booking Calendar' ),
223 'font_icon' => 'wpbc_icn_widgets', // Left Vertical Menu - Icon.
224 'link' => '', // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link.
225 'css_classes' => '', // CSS.
226 'icon' => '', // Icon - link to the real PNG img.
227 'default' => false, // Is this tab activated by default or not: true / false.
228 'folder_style' => 'order:1000',
229 );
230
231 $subtabs = array();
232
233 $section_id = 'wpbc_general_settings_booking_listing_metabox';
234 $subtabs['booking_listing'] = array_merge(
235 $subtab_default,
236 array(
237 'title' => __( 'Booking Admin Panel', 'booking' ),
238 'page_title' => __( 'General Settings', 'booking' ),
239 'hint' => __( 'Configure various options and settings in the admin panel.', 'booking' ),
240 'font_icon' => 'wpbc-bi-list',
241 'font_icon_right' => 'wpbc-bi-question-circle',
242 'css_classes' => 'do_expand__' . $section_id . '_link',
243 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
244 'default' => false,
245 )
246 );
247
248 $section_id = 'wpbc_general_settings_booking_calendar_overview_metabox';
249 $subtabs['booking_calendar_overview'] = array_merge(
250 $subtab_default,
251 array(
252 'title' => __( 'Timeline View (Back-End)', 'booking' ),
253 'page_title' => __( 'General Settings', 'booking' ),
254 'hint' => __( 'Customize timeline options in the admin panel, including displaying booking details.', 'booking' ),
255 'font_icon' => 'wpbc-bi-bar-chart-steps _icn_timeline 0wpbc_icn_rotate_45 0wpbc_icn_align_vertical_bottom',
256 'font_icon_right' => 'wpbc-bi-question-circle',
257 'css_classes' => 'do_expand__' . $section_id . '_link',
258 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
259 'default' => false,
260 )
261 );
262
263 $section_id = 'wpbc_general_settings_datestimes_metabox';
264 $subtabs['datestimes'] = array_merge(
265 $subtab_default,
266 array(
267 'title' => __( 'Date and Time Formats', 'booking' ),
268 'page_title' => __( 'General Settings', 'booking' ),
269 'hint' => __( 'Customize the display format for dates and times.', 'booking' ),
270 'font_icon' => 'wpbc-bi-braces-asterisk _icn_password',
271 'font_icon_right' => 'wpbc-bi-question-circle',
272 'css_classes' => 'do_expand__' . $section_id . '_link',
273 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
274 'default' => false,
275 )
276 );
277
278 $section_id = 'wpbc_general_settings_permissions_metabox';
279 $subtabs['permissions'] = array_merge(
280 $subtab_default,
281 array(
282 'title' => __( 'Plugin Menu / Permissions', 'booking' ),
283 'page_title' => __( 'General Settings', 'booking' ),
284 'hint' => __( 'Set user permissions for accessing plugin menu pages and configure the menu position.', 'booking' ),
285 'font_icon' => 'wpbc-bi-key',
286 'font_icon_right' => 'wpbc-bi-question-circle',
287 'css_classes' => 'do_expand__' . $section_id . '_link',
288 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
289 'default' => false,
290 )
291 );
292
293 $section_id = 'wpbc_general_settings_translations_metabox';
294 $subtabs['translations'] = array_merge(
295 $subtab_default,
296 array(
297 'title' => __( 'Translations', 'booking' ),
298 'page_title' => __( 'General Settings', 'booking' ),
299 'hint' => __( 'Choose whether to use local translations or WordPress translations.', 'booking' ),
300 'font_icon' => 'wpbc_icn_translate 0wpbc-bi-translate',
301 'font_icon_right' => 'wpbc-bi-question-circle',
302 'css_classes' => 'do_expand__' . $section_id . '_link',
303 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
304 'default' => false,
305 )
306 );
307
308 $tabs['admin_panel']['subtabs'] = $subtabs;
309
310
311 // =============================================================================================================
312 // == Advanced ==
313 // =============================================================================================================
314 $tabs['advanced'] = array(
315 'is_show_top_path' => true, // true | false. By default value is: true.
316 'is_show_top_navigation' => false, // true | false. By default value is: false.
317 'left_navigation__default_view_mode' => '', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''.
318 'page_title' => __( 'General Settings', 'booking' ), // Header - Title. If false, than hidden.
319 // translators: 1: Booking Calendar.
320 'page_description' => sprintf( __( 'Configure various options and settings in the %s.', 'booking' ), 'Booking Calendar' ),
321 'title' => __( 'Advanced', 'booking' ), // Left Vertical Menu - Title.
322 // translators: 1: Booking Calendar.
323 'hint' => sprintf( __( 'Configure various options and settings in the %s.', 'booking' ), 'Booking Calendar' ),
324 'font_icon' => 'wpbc-bi-gear', // Left Vertical Menu - Icon.
325 'link' => '', // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link.
326 'css_classes' => '', // CSS.
327 'icon' => '', // Icon - link to the real PNG img.
328 'default' => false, // Is this tab activated by default or not: true / false.
329 'folder_style' => 'order:1000',
330 );
331
332 $subtabs = array();
333
334 $section_id = 'wpbc_general_settings_advanced_metabox';
335 $subtabs['advanced_options'] = array_merge(
336 $subtab_default,
337 array(
338 'title' => __( 'Advanced Options', 'booking' ),
339 'page_title' => __( 'General Settings', 'booking' ),
340 'hint' => __( 'Configure loading of CSS/JavaScript files, set the number of simultaneous requests, and other advanced options.', 'booking' ),
341 'font_icon' => 'wpbc_icn_adjust',
342 'font_icon_right' => 'wpbc-bi-question-circle',
343 'css_classes' => 'do_expand__' . $section_id . '_link',
344 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
345 'default' => false,
346 )
347 );
348
349 $section_id = 'wpbc_general_settings_uninstall_metabox';
350 $subtabs['uninstall'] = array_merge(
351 $subtab_default,
352 array(
353 'title' => __( 'Uninstall / Deactivation', 'booking' ),
354 'page_title' => __( 'General Settings', 'booking' ),
355 'hint' => __( 'Enable the option to fully erase booking data when the plugin is deactivated.', 'booking' ),
356 'font_icon' => 'wpbc-bi-trash',
357 'font_icon_right' => 'wpbc-bi-question-circle',
358 'css_classes' => 'do_expand__' . $section_id . '_link',
359 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
360 'default' => false,
361 )
362 );
363
364 $section_id = 'wpbc_general_settings_information_metabox';
365 $subtabs['information'] = array_merge(
366 $subtab_default,
367 array(
368 'title' => __( 'Plugin Info & News', 'booking' ),
369 'page_title' => __( 'General Settings', 'booking' ),
370 'hint' => __( 'Stay informed with the latest news and details about the plugin.', 'booking' ),
371 'font_icon' => 'wpbc_icn_newspaper -bi-newspaper _icn_news 0wpbc-bi-translate',
372 'font_icon_right' => 'wpbc-bi-question-circle',
373 'css_classes' => 'do_expand__' . $section_id . '_link',
374 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
375 'default' => false,
376 )
377 );
378
379 $section_id = 'wpbc_general_settings_help_metabox';
380 $subtabs['tools'] = array_merge(
381 $subtab_default,
382 array(
383 'title' => __( 'Tools', 'booking' ),
384 'page_title' => __( 'General Settings', 'booking' ),
385 'hint' => '', //__( 'Stay informed with the latest news and details about the plugin. ', 'booking' ),
386 'font_icon' => 'wpbc_icn_construction',
387 'font_icon_right' => '',
388 'css_classes' => 'do_expand__' . $section_id . '_link',
389 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
390 'default' => false,
391 )
392 );
393 if ( class_exists('wpdev_bk_multiuser') ) {
394 $section_id = 'wpbc_general_settings_multiuser_metabox';
395 $subtabs['multiuser'] = array_merge(
396 $subtab_default,
397 array(
398 'title' => __( 'Multiuser Options', 'booking' ),
399 'page_title' => __( 'General Settings', 'booking' ),
400 'hint' => __( 'Multiuser Options', 'booking' ),
401 'font_icon' => 'wpbc_icn_people_alt',
402 'font_icon_right' => 'wpbc-bi-question-circle',
403 'css_classes' => 'do_expand__' . $section_id . '_link',
404 'onclick' => "wpbc_admin_ui__do__open_url__expand_section( '" . wpbc_get_settings_url() . "', '" . $section_id . "' );",
405 'default' => false,
406 )
407 );
408 }
409
410 $tabs['advanced']['subtabs'] = $subtabs;
411
412 // FixIn: 10.12.4.7. $tabs[ 'settings' . ( ++$separator_i ) ] = array_merge( $subtab_default, array( 'type' => 'separator' ,'folder_style' => 'order:900;' ) );
413 // $tabs[ 'settings' . ( ++$separator_i ) ] = array_merge( $subtab_default, array( 'type' => 'separator' ,'folder_style' => 'order:1000;' ) );
414
415 return $tabs;
416 }
417
418
419 public function content() {
420
421 // Checking.
422
423 do_action( 'wpbc_hook_settings_page_header', 'general_settings' ); // Define Notices Section and show some static messages, if needed.
424
425 if ( ! wpbc_is_mu_user_can_be_here( 'activated_user' ) ) {
426 return false;
427 } // Check if MU user activated, otherwise show Warning message.
428
429 if ( ! wpbc_is_mu_user_can_be_here( 'only_super_admin' ) ) {
430 return false;
431 } // User is not Super admin, so exit. Basically its was already checked at the bottom of the PHP file, just in case.
432
433 // Redirect legacy Settings > Calendar links to the dedicated Calendar settings page.
434 // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
435 if ( ! empty( $_GET['scroll_to_section'] ) ) {
436 $scroll_to_section = sanitize_text_field( wp_unslash( $_GET['scroll_to_section'] ) );
437
438 if ( 'wpbc_general_settings_calendar_tab' === $scroll_to_section ) {
439 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' ) );
440 return;
441 }
442
443 if ( 'wpbc_general_settings_days_tooltips_tab' === $scroll_to_section ) {
444 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' ) );
445 return;
446 }
447
448 if ( 'wpbc_general_settings_availability_tab' === $scroll_to_section ) {
449 wpbc_redirect( function_exists( 'wpbc_get_general_availability_url' ) ? wpbc_get_general_availability_url() : admin_url( 'admin.php?page=wpbc-availability&tab=general_availability' ) );
450 return;
451 }
452 }
453
454 $is_can = apply_bk_filter( 'recheck_version', true );
455 if ( ! $is_can ) {
456 ?>
457 <script type="text/javascript"> jQuery(document).ready(function () {
458 jQuery('.wpdvlp-sub-tabs').remove();
459 });
460 </script>
461 <?php
462 return;
463 }
464
465
466 // Init Settings API & Get Data from DB.
467 $this->settings_api(); // Define all fields and get values from DB.
468
469 // Submit .
470
471 $submit_form_name = 'wpbc_general_settings_form'; // Define form name.
472
473 // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
474 if ( isset( $_POST[ 'is_form_sbmitted_' . $submit_form_name ] ) ) {
475
476 // Nonce checking {Return false if invalid, 1 if generated between, 0-12 hours ago, 2 if generated between 12-24 hours ago. }.
477 $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.
478
479 // Save Changes .
480 $this->update();
481 }
482 // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
483 if ( ! empty( $_GET['scroll_to_section'] ) ) {
484 ?>
485 <script type="text/javascript">
486 jQuery(document).ready(function () {
487 jQuery('#<?php echo esc_js( sanitize_text_field( wp_unslash( $_GET['scroll_to_section'] ) ) ); ?> a').trigger('click');
488 });
489 </script>
490 <?php
491 }
492
493 // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
494 if ( ( isset( $_GET['wpbc_setup_wizard'] ) ) && ( 'reset' === $_GET['wpbc_setup_wizard'] ) ) {
495
496 wpbc_setup_wizard_page__force_in_get();
497
498 ?>
499 <div class="wpdvlp-sub-tabs wpbc_redirection_message" style="margin: 20px 0;padding: 1em;font-size: 14px;">
500 <a href="<?php echo esc_url( wpbc_get_setup_wizard_page_url() ); ?>">Redirect</a> after <span class="wpbc_countdown">1</span> second...</div>
501 <?php
502
503 wpbc_redirect( wpbc_get_setup_wizard_page_url() );
504 }
505
506 // JavaScript: Tooltips, Popover, Datepick (js & css) .
507 echo '<span class="wpdevelop">';
508 wpbc_js_for_bookings_page();
509 echo '</span>';
510
511 // TODO: 2025-05-05 update in real top path. wpbc_ui_settings__top_path();
512
513 // Content .
514 ?>
515 <div class="clear"></div>
516 <div class="wpbc_settings_flex_container">
517
518 <div class="wpbc_settings_flex_container_left" style="display:none;">
519
520 <div class="wpbc_settings_navigation_column">
521
522 <div id="wpbc_general_settings_dashboard_tab" class="wpbc_settings_navigation_item wpbc_settings_navigation_item_active">
523 <?php
524 $title = esc_attr__( 'Dashboard', 'booking' );
525 ?>
526 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_dashboard_tab a' ,'#wpbc_general_settings_dashboard_metabox', '<?php echo esc_js( $title ); ?>' );"
527 href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
528 </div>
529 <div id="wpbc_general_settings_form_tab" class="wpbc_settings_navigation_item">
530 <?php
531 $title = esc_attr__( 'Form Options', 'booking' );
532 ?>
533 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_form_tab a' ,'#wpbc_general_settings_form_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
534 </div>
535 <div id="wpbc_general_settings_time_slots_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
536 <?php
537 $title = esc_attr__( 'Time Slots', 'booking' );
538 ?>
539 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_time_slots_tab a' ,'#wpbc_general_settings_time_slots_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
540 </div>
541 <div id="wpbc_general_settings_booking_confirmation_tab" class="wpbc_settings_navigation_item">
542 <?php
543 $title = esc_attr__( 'Booking Confirmation', 'booking' );
544 ?>
545 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_booking_confirmation_tab a' ,'#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', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
546 </div>
547
548 <div id="wpbc_general_settings_booking_timeline_tab" class="wpbc_settings_navigation_item wpbc_navigation_top_border">
549 <?php
550 $title = esc_attr__( 'Timeline (front-end)', 'booking' );
551 ?>
552 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_booking_timeline_tab a' ,'#wpbc_general_settings_booking_timeline_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
553 </div>
554 <?php if ( class_exists('wpdev_bk_personal') ) { ?>
555 <div id="wpbc_general_settings_bookings_options_tab" class="wpbc_settings_navigation_item wpbc_navigation_top_border">
556 <?php
557 $title = esc_attr__( 'Manage Bookings', 'booking' );
558 ?>
559 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_bookings_options_tab a' ,'#wpbc_general_settings_bookings_options_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
560 </div>
561 <?php } ?>
562
563 <?php if ( class_exists('wpdev_bk_biz_s') ) { ?>
564 <div id="wpbc_general_settings_auto_cancelation_approval_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
565 <?php
566 $title = esc_attr__( 'Auto Cancellation / Auto Approval', 'booking' );
567 ?>
568 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_auto_cancelation_approval_tab a' ,'#wpbc_general_settings_auto_cancelation_approval_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
569 </div>
570 <?php } ?>
571
572
573 <?php if ( class_exists('wpdev_bk_multiuser') ) { ?>
574 <div id="wpbc_general_settings_multiuser_tab" class="wpbc_settings_navigation_item">
575 <?php
576 $title = esc_attr__( 'Multiuser options', 'booking' );
577 ?>
578 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_multiuser_tab a' ,'#wpbc_general_settings_multiuser_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
579 </div>
580 <?php } ?>
581
582 <div id="wpbc_general_settings_booking_listing_tab" class="wpbc_settings_navigation_item wpbc_navigation_top_border">
583 <?php
584 $title = esc_attr__( 'Admin Panel', 'booking' );
585 ?>
586 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_booking_listing_tab a' ,'#wpbc_general_settings_booking_listing_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
587 </div>
588 <div id="wpbc_general_settings_booking_calendar_overview_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
589 <?php
590 $title = esc_attr__( 'Timeline View', 'booking' );
591 ?>
592 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_booking_calendar_overview_tab a' ,'#wpbc_general_settings_booking_calendar_overview_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
593 </div>
594 <div id="wpbc_general_settings_datestimes_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
595 <?php
596 $title = esc_attr__( 'Date / Time Formats', 'booking' );
597 ?>
598 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_datestimes_tab a' ,'#wpbc_general_settings_datestimes_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
599 </div>
600 <div id="wpbc_general_settings_permissions_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
601 <?php
602 $title = esc_attr__( 'Plugin Menu / Permissions', 'booking' );
603 ?>
604 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_permissions_tab a' ,'#wpbc_general_settings_permissions_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
605 </div>
606 <div id="wpbc_general_settings_translations_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
607 <?php
608 $title = esc_attr__( 'Translations', 'booking' );
609 ?>
610 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_translations_tab a' ,'#wpbc_general_settings_translations_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
611 </div>
612 <div id="wpbc_general_settings_advanced_tab" class="wpbc_settings_navigation_item">
613 <?php
614 $title = esc_attr__( 'Advanced', 'booking' );
615 ?>
616 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_advanced_tab a' ,'#wpbc_general_settings_advanced_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
617 </div>
618 <div id="wpbc_general_settings_uninstall_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
619 <?php
620 $title = esc_attr__( 'Uninstall / deactivation', 'booking' );
621 ?>
622 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_uninstall_tab a' ,'#wpbc_general_settings_uninstall_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
623 </div>
624 <div id="wpbc_general_settings_information_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
625 <?php
626 $title = esc_attr__( 'Info / News', 'booking' );
627 ?>
628 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_information_tab a' ,'#wpbc_general_settings_information_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
629 </div>
630 <?php if ( ( class_exists('wpdev_bk_personal') ) && ( ! wpbc_is_this_demo() ) ) { ?>
631 <div id="wpbc_general_settings_help_tab" class="wpbc_settings_navigation_item wpbc_navigation_sub_item">
632 <?php
633 $title = esc_attr__( 'Tools', 'booking' );
634 ?>
635 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_help_tab a' ,'#wpbc_general_settings_help_metabox', '<?php echo esc_js( $title ); ?>' );" href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
636 </div>
637 <?php } ?>
638
639 <div id="wpbc_general_settings_all_tab" class="wpbc_settings_navigation_item wpbc_navigation_top_border">
640 <?php
641 $title = esc_attr__( 'Show All Settings', 'booking' );
642 ?>
643 <a onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_all_tab a' ,'.postbox', '<?php echo esc_js( $title ); ?>' );"
644 href="javascript:void(0);"><span><?php echo esc_html( $title ); ?></span></a>
645 </div>
646
647 </div>
648
649 </div>
650 <div class="wpbc_settings_flex_container_right">
651
652 <span class="metabox-holder">
653 <form name="<?php echo esc_attr( $submit_form_name ); ?>" id="<?php echo esc_attr( $submit_form_name ); ?>" action="" method="post">
654 <?php
655 // N o n c e field, and key for checking S u b m i t.
656 wp_nonce_field( 'wpbc_settings_page_' . $submit_form_name );
657 ?>
658 <input type="hidden" name="is_form_sbmitted_<?php echo esc_attr( $submit_form_name ); ?>" id="is_form_sbmitted_<?php echo esc_attr( $submit_form_name ); ?>" value="1"/>
659 <input type="hidden" name="form_visible_section" id="form_visible_section" value=""/>
660
661 <?php
662 if ( wpbc_is_show_general_setting_options() ) {
663 // FixIn: 8.9.4.11.
664 ?>
665
666 <div class="wpbc_settings_row wpbc_settings_row_full_width" >
667
668 <div id="wpbc_general_settings_dashboard_metabox" class="postbox"
669 style="background: transparent;border: 0;box-shadow: none;"><?php //wpbc_open_meta_box_section( 'wpbc_general_settings_dashboard', __('Dashboard'), array( 'is_section_visible_after_load' => true, 'is_show_minimize' => false ) ); ?>
670 <?php
671
672 wpbc_ui_settings__panel__statistic();
673
674 wpbc_ui_settings__panel__all_settings_panels();
675
676 wpbc_ui_settings__panel__plugin_version();
677
678 ?></div><?php //wpbc_close_meta_box_section(); ?>
679
680 <?php
681 wpbc_open_meta_box_section( 'wpbc_general_settings_booking_confirmation',
682 __( 'Booking Confirmation', 'booking' ),
683 array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) );
684 $this->settings_api()->show( 'booking_confirmation' );
685 wpbc_close_meta_box_section();
686 ?>
687 <div class="wpbc_settings_row wpbc_settings_row_left">
688 <?php
689 wpbc_open_meta_box_section( 'wpbc_general_settings_booking_confirmation_left',
690 __( 'Section', 'booking' ) . ': ' . __( 'Personal Information', 'booking' ),
691 array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) );
692 $this->settings_api()->show( 'booking_confirmation_left' );
693 wpbc_close_meta_box_section();
694
695 wpbc_open_meta_box_section( 'wpbc_general_settings_booking_confirmation_right',
696 __( 'Section', 'booking' ) . ': ' . __( 'Booking details', 'booking' ),
697 array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) );
698 $this->settings_api()->show( 'booking_confirmation_right' );
699 wpbc_close_meta_box_section();
700 ?>
701 </div>
702 <div class="wpbc_settings_row wpbc_settings_row_right">
703 <?php
704 wpbc_open_meta_box_section( 'wpbc_general_settings_booking_confirmation_help',
705 __( 'Shortcodes', 'booking' ),
706 array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) );
707 $this->settings_api()->show( 'booking_confirmation_help' );
708 wpbc_close_meta_box_section();
709 ?>
710 </div>
711 <div class="clear"></div>
712
713 <?php if ( class_exists('wpdev_bk_personal') ) { ?>
714 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_bookings_options', __('Bookings Options', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
715
716 <?php $this->settings_api()->show( 'bookings_options' ); ?>
717
718 <?php wpbc_close_meta_box_section(); ?>
719 <?php } ?>
720
721
722 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_booking_listing', __('Booking Admin Panel', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
723
724 <?php $this->settings_api()->show( 'booking_listing' ); ?>
725
726 <?php wpbc_close_meta_box_section(); ?>
727
728
729 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_booking_calendar_overview', __('Calendar Overview (admin panel)', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
730
731 <?php // FixIn: 8.5.2.20.
732 $this->settings_api()->show( 'booking_calendar_overview' );
733 ?>
734
735 <?php wpbc_close_meta_box_section(); ?>
736
737
738 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_booking_timeline', __('Timeline (front-end)', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
739
740 <?php
741 $this->settings_api()->show( 'booking_timeline' );
742 ?>
743
744 <?php wpbc_close_meta_box_section(); ?>
745
746
747 <?php if ( class_exists('wpdev_bk_biz_s') ) { ?>
748
749
750 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_auto_cancelation_approval', __('Auto cancellation / auto approval of bookings', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
751
752 <?php $this->settings_api()->show( 'auto_cancelation_approval' ); ?>
753
754 <?php wpbc_close_meta_box_section(); ?>
755
756 <?php } ?>
757
758 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_advanced', __('Advanced', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
759
760 <?php $this->settings_api()->show( 'advanced' ); ?>
761
762 <?php wpbc_close_meta_box_section(); ?>
763
764
765 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_information', __('Information', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
766
767 <?php $this->settings_api()->show( 'information' ); ?>
768
769 <?php wpbc_close_meta_box_section(); ?>
770
771
772
773 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_datestimes', __('Date : Time', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
774
775 <?php $this->settings_api()->show( 'date_time' ); ?>
776
777 <?php wpbc_close_meta_box_section(); ?>
778
779
780
781 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_permissions', __('Plugin Menu', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
782
783 <?php $this->settings_api()->show( 'permissions' ); ?>
784
785 <?php wpbc_close_meta_box_section(); ?>
786
787
788 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_uninstall', __('Uninstall / deactivation', 'booking'), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
789
790 <?php $this->settings_api()->show( 'uninstall' ); ?>
791
792 <?php wpbc_close_meta_box_section(); ?>
793
794 <?php if ( ( class_exists( 'wpdev_bk_personal' ) ) && ( ! wpbc_is_this_demo() ) ) { ?>
795 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_help', __( 'Tools', 'booking' ), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
796
797 <?php $this->settings_api()->show( 'help' ); ?>
798
799 <?php wpbc_close_meta_box_section(); ?>
800 <?php } ?>
801
802 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_translations', __( 'Translations', 'booking' ), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
803
804 <?php $this->settings_api()->show( 'translations' ); ?>
805
806 <?php wpbc_translation_buttons_settings_section(); ?>
807
808 <?php wpbc_close_meta_box_section(); ?>
809
810 <?php if ( class_exists( 'wpdev_bk_multiuser' ) ) { // FixIn: 9.2.3.8. ?>
811
812 <?php wpbc_open_meta_box_section( 'wpbc_general_settings_multiuser', __( 'Multiuser options', 'booking' ), array( 'is_section_visible_after_load' => false, 'is_show_minimize' => false ) ); ?>
813
814 <?php $this->settings_api()->show( 'multiuser' ); ?>
815
816 <?php wpbc_close_meta_box_section(); ?>
817
818 <?php } ?>
819
820 </div>
821 <div class="clear"></div>
822 <div class="container_for_save_buttons">
823 <input type="submit" value="<?php esc_attr_e( 'Save Changes', 'booking' ); ?>" class="button button-primary wpbc_submit_button"/>
824 <span class="sub_right">
825 <a style="margin:0;" class="button button"
826 onclick="javascript:wpbc_ui_settings__panel__click( '#wpbc_general_settings_all_tab a' ,'.postbox', 'Show All Settings' );"
827 href="javascript:void(0);">
828 <?php
829 esc_html_e( 'Show All Settings', 'booking' )
830 ?>
831 </a>
832 <?php
833 if ( 'translations_updated_from_wpbc_and_wp' !== get_bk_option( 'booking_translation_update_status' ) ) {
834
835 $current_locale = wpbc_get_maybe_reloaded_booking_locale();
836
837 if ( ! in_array( $current_locale, array( 'en_US', 'en_CA', 'en_GB', 'en_AU' ), true ) ) {
838
839 echo '<a class="button button" href="'
840 . esc_url( wpbc_get_settings_url() . '&system_info=show&_wpnonce=' . wp_create_nonce( 'wpbc_settings_url_nonce' ) . '&update_translations=1#wpbc_general_settings_system_info_metabox' )
841 . '">'
842 . esc_html__( 'Update Translations', 'booking' )
843 . '</a>';
844 }
845 }
846
847 if ( ! wpbc_is_this_demo() ) {
848
849 echo '<a style="margin:0 2em;" class="button button" href="'
850 . esc_url( wpbc_get_settings_url() . '&system_info=show&_wpnonce=' . wp_create_nonce( 'wpbc_settings_url_nonce' ) . '&restore_dismissed=On#wpbc_general_settings_restore_dismissed_metabox' )
851 . '">'
852 . esc_html__( 'Restore all dismissed windows', 'booking' )
853 . '</a>';
854 }
855 ?>
856 </span>
857 </div>
858
859 <?php } ?>
860 </form>
861 </span>
862
863 </div>
864 </div>
865
866
867 <?php
868
869 do_action( 'wpbc_hook_settings_page_footer', 'general_settings' );
870 }
871
872
873 public function update() {
874
875 $validated_fields = $this->settings_api()->validate_post(); // Get Validated Settings fields in $_POST request.
876
877 $validated_fields = apply_filters( 'wpbc_settings_validate_fields_before_saving', $validated_fields ); // Hook for validated fields.
878
879 foreach ( $this->settings_api()->get_form_fields() as $field_name => $field ) {
880 if ( ! empty( $field['group'] ) && in_array( $field['group'], array( 'calendar', 'days_tooltips', 'availability' ), true ) ) {
881 unset( $validated_fields[ $field_name ] );
882 }
883 }
884
885 /**
886 * Skip saving specific option, for example in Demo mode.
887 * // unset( $validated_fields['booking_start_day_weeek'] );
888 */
889
890 // FixIn: 9.8.6.1.
891 // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
892 if ( ! empty( $_POST['form_visible_section'] ) ) {
893 ?>
894 <script type="text/javascript">
895 jQuery(document).ready(function () {
896 jQuery('<?php
897 // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
898 echo esc_js( $_POST['form_visible_section'] );
899 ?> a').trigger('click');
900 });
901 </script>
902 <?php
903 }
904
905 $this->settings_api()->save_to_db( $validated_fields ); // Save fields to DB.
906
907 wpbc_show_changes_saved_message();
908
909 /**
910 * // O L D W A Y: Saving Fields Data
911 * // update_bk_option( 'booking_is_delete_if_deactive'
912 * // , WPBC_Settings_API::validate_checkbox_post('booking_is_delete_if_deactive') );
913 * // ( (isset( $_POST['booking_is_delete_if_deactive'] ))?'On':'Off') );
914 */
915 }
916 }
917
918
919 /**
920 *
921
922 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
923
924 if ( ( ! isset( $ _GET['tab'] ) ) || ( $_GET['tab'] == 'general' ) ) { // If tab was not selected or selected default, then redirect it to the "form" tab.
925 $_GET['tab'] = 'form';
926 }
927 } else {
928 add_action('wpbc_menu_created', array( new WPBC_Page_SettingsGeneral() , '__construct') ); // Executed after creation of Menu
929 }
930 */
931
932 add_action('wpbc_menu_created', array( new WPBC_Page_SettingsGeneral() , '__construct') ); // Executed after creation of Menu
933
934