PluginProbe
Booking Calendar / 10.15.6
Booking Calendar v10.15.6
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 / includes / _capacity / calendar_load.php

calendar_load.php in Booking Calendar 10.15.6, at includes/_capacity/calendar_load.php

384 lines 22.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @file: wp-content/plugins/booking/includes/_capacity/calendar_load.php
4 */
5
6 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly // FixIn: 9.8.0.4.
7
8 /**
9 * Define parameters for calendar -- required for JS calendar show
10 *
11 * @param array $params
12 *
13 * @return string JS code body (no <script> wrapper)
14 */
15 function wpbc__calendar__set_js_params__before_show( $params ) {
16
17 $start_script_code = '';
18
19 // Server Balancer.
20 $balancer_max_threads = intval( get_bk_option( 'booking_load_balancer_max_threads' ) );
21 $balancer_max_threads = ( empty( $balancer_max_threads ) ) ? 1 : $balancer_max_threads;
22 $start_script_code .= " _wpbc.balancer__set_max_threads( " . $balancer_max_threads . " ); ";
23
24 $resource_id = isset( $params['resource_id'] ) ? absint( $params['resource_id'] ) : 1;
25
26 // Start Month (require [year,month]).
27 $calendar_scroll_to = 'false';
28 if (
29 isset( $params['start_month_calendar'] )
30 && is_array( $params['start_month_calendar'] )
31 && ( count( $params['start_month_calendar'] ) > 1 )
32 ) {
33 $y = intval( $params['start_month_calendar'][0] );
34 $m = intval( $params['start_month_calendar'][1] );
35 if ( ( $y > 0 ) && ( $m > 0 ) ) {
36 $calendar_scroll_to = "[ " . (string) $y . "," . (string) $m . " ]";
37 }
38 }
39 $start_script_code .= " _wpbc.calendar__set_param_value( " . $resource_id . " , 'calendar_scroll_to' , " . $calendar_scroll_to . " ); ";
40
41 // Set Start / End Date in Calendar (JSON encode => safe quotes).
42 $params['calendar_dates_start'] = ( empty( $params['calendar_dates_start'] ) ) ? '' : (string) $params['calendar_dates_start'];
43 $params['calendar_dates_end'] = ( empty( $params['calendar_dates_end'] ) ) ? '' : (string) $params['calendar_dates_end'];
44
45 $start_script_code .= " _wpbc.calendar__set_param_value( " . $resource_id . " , 'calendar_dates_start' , " . wp_json_encode( $params['calendar_dates_start'] ) . " ); ";
46 $start_script_code .= " _wpbc.calendar__set_param_value( " . $resource_id . " , 'calendar_dates_end' , " . wp_json_encode( $params['calendar_dates_end'] ) . " ); ";
47
48 if ( ( '' !== $params['calendar_dates_start'] ) || ( '' !== $params['calendar_dates_end'] ) ) {
49 $start_script_code .= wpbc_get_localized_js__time_local( $params['calendar_dates_start'] );
50 }
51
52 // Max months to scroll.
53 $start_script_code .= " _wpbc.calendar__set_param_value( " . $resource_id . " , 'booking_max_monthes_in_calendar' , " . wp_json_encode( (string) get_bk_option( 'booking_max_monthes_in_calendar' ) ) . " ); ";
54
55 // Start of week day.
56 $start_script_code .= " _wpbc.calendar__set_param_value( " . $resource_id . " , 'booking_start_day_weeek' , " . wp_json_encode( (string) get_bk_option( 'booking_start_day_weeek' ) ) . " ); ";
57
58 // Number of visible months.
59 $months_num = isset( $params['calendar_number_of_months'] ) ? (int) $params['calendar_number_of_months'] : 1;
60 $months_num = max( 1, min( 36, $months_num ) );
61 $start_script_code .= " _wpbc.calendar__set_param_value( " . $resource_id . " , 'calendar_number_of_months' , " . wp_json_encode( (string) $months_num ) . " ); ";
62
63 // Days Selection.
64 $days_selection_arr = wpbc__calendar__js_params__get_days_selection_arr();
65
66 $start_script_code .= " _wpbc.calendar__set_param_value( " . $resource_id . ", 'days_select_mode', " . wp_json_encode( (string) $days_selection_arr['days_select_mode'] ) . " ); ";
67 $start_script_code .= " _wpbc.calendar__set_param_value( " . $resource_id . ", 'fixed__days_num', " . intval( $days_selection_arr['fixed__days_num'] ) . " ); ";
68
69 // Keep legacy: these are stored as comma lists like "-1" or "0,1".
70 $start_script_code .= " _wpbc.calendar__set_param_value( " . $resource_id . ", 'fixed__week_days__start', [" . $days_selection_arr['fixed__week_days__start'] . "] ); ";
71 $start_script_code .= " _wpbc.calendar__set_param_value( " . $resource_id . ", 'dynamic__days_min', " . intval( $days_selection_arr['dynamic__days_min'] ) . " ); ";
72 $start_script_code .= " _wpbc.calendar__set_param_value( " . $resource_id . ", 'dynamic__days_max', " . intval( $days_selection_arr['dynamic__days_max'] ) . " ); ";
73 $start_script_code .= " _wpbc.calendar__set_param_value( " . $resource_id . ", 'dynamic__days_specific', [" . $days_selection_arr['dynamic__days_specific'] . "] ); ";
74 $start_script_code .= " _wpbc.calendar__set_param_value( " . $resource_id . ", 'dynamic__week_days__start', [" . $days_selection_arr['dynamic__week_days__start'] . "] ); ";
75
76 // Date / Time formats.
77 $start_script_code .= " _wpbc.calendar__set_param_value( " . $resource_id . ", 'booking_date_format', " . wp_json_encode( (string) get_bk_option( 'booking_date_format' ) ) . " ); ";
78 $start_script_code .= " _wpbc.calendar__set_param_value( " . $resource_id . ", 'booking_time_format', " . wp_json_encode( (string) get_bk_option( 'booking_time_format' ) ) . " ); ";
79
80 // Capacity | availability.
81 if ( class_exists( 'wpdev_bk_biz_l' ) ) {
82 $start_script_code .= " _wpbc.calendar__set_param_value( " . $resource_id . " , 'is_parent_resource' , " . ( wpbc_get_child_resources_number( $resource_id ) ? 1 : 0 ) . " ); ";
83 $start_script_code .= " _wpbc.calendar__set_param_value( " . $resource_id . " , 'booking_capacity_field' , " . wp_json_encode( (string) wpbc_get__booking_capacity_field__name() ) . " ); ";
84 $start_script_code .= " _wpbc.calendar__set_param_value( " . $resource_id . " , 'booking_is_dissbale_booking_for_different_sub_resources' , " . wp_json_encode( (string) get_bk_option( 'booking_is_dissbale_booking_for_different_sub_resources' ) ) . " ); ";
85 }
86 if ( class_exists( 'wpdev_bk_biz_s' ) ) {
87 $start_script_code .= " _wpbc.calendar__set_param_value( " . $resource_id . " , 'booking_recurrent_time' , " . wp_json_encode( (string) get_bk_option( 'booking_recurrent_time' ) ) . " ); ";
88 }
89
90 // Save initial values of days selection for later use in conditional day logic.
91 $start_script_code .= " if ( 'function' === typeof ( wpbc__conditions__SAVE_INITIAL__days_selection_params__bm ) ) { wpbc__conditions__SAVE_INITIAL__days_selection_params__bm( " . $resource_id . " ); } ";
92
93 if (
94 ( ! empty( $params['shortcode_options'] ) )
95 && ( function_exists( 'wpbc_parse_shortcode_option__set_days_selection_conditions' ) )
96 ) {
97 $days_selection_conditions = wpbc_parse_shortcode_option__set_days_selection_conditions( $resource_id, $params['shortcode_options'] );
98
99 if ( ! empty( $days_selection_conditions ) ) {
100 $start_script_code .= " _wpbc.calendar__set_param_value( " . $resource_id . ", 'conditions', " . wp_json_encode( $days_selection_conditions['conditions'] ) . " ); ";
101 $start_script_code .= " _wpbc.seasons__set( " . $resource_id . ", " . wp_json_encode( $days_selection_conditions['seasons'] ) . " ); ";
102 }
103 }
104
105 return $start_script_code;
106 }
107
108
109 /**
110 * Get days selection parameters, which saved in database
111 *
112 * @return array
113 */
114 function wpbc__calendar__js_params__get_days_selection_arr(){
115
116 $specific_days_selection = ( function_exists( 'wpbc_get_specific_range_dates__as_comma_list' ) )
117 ? wpbc_get_specific_range_dates__as_comma_list( get_bk_option( 'booking_range_selection_days_specific_num_dynamic' ) )
118 : '';
119 $data_arr = array();
120 // Modes :: Selection of Days
121 $data_arr['days_select_mode'] = ( 'range' === get_bk_option('booking_type_of_day_selections') )
122 ? get_bk_option('booking_range_selection_type')
123 : get_bk_option( 'booking_type_of_day_selections');
124 $data_arr['fixed__days_num'] = intval( get_bk_option( 'booking_range_selection_days_count' ) ); /* Number of days selection with 1 mouse click */
125 $data_arr['fixed__week_days__start'] = get_bk_option( 'booking_range_start_day' ); /* { -1 - Any | 0 - Su, 1 - Mo, 2 - Tu, 3 - We, 4 - Th, 5 - Fr, 6 - Sat } */
126 $data_arr['dynamic__days_min'] = intval( get_bk_option( 'booking_range_selection_days_count_dynamic' ) ); /* Min. Number of days selection with 2 mouse clicks */
127 $data_arr['dynamic__days_max'] = intval( get_bk_option( 'booking_range_selection_days_max_count_dynamic' ) ); /* Max. Number of days selection with 2 mouse clicks */
128 $data_arr['dynamic__days_specific'] = $specific_days_selection; /* Example: '5,7' */
129 $data_arr['dynamic__week_days__start'] = get_bk_option( 'booking_range_start_day_dynamic' ); /* { -1 - Any | 0 - Su, 1 - Mo, 2 - Tu, 3 - We, 4 - Th, 5 - Fr, 6 - Sat } */
130
131 // Fix about possible issue of downgrade from Paid to free version and try to use 'Range days' selection, which is not supports in that version. // FixIn: 10.4.0.4.
132 if ( ( ! class_exists( 'wpdev_bk_biz_s' ) ) && ( in_array( $data_arr['days_select_mode'], array( 'dynamic', 'fixed' ) ) ) ) {
133 $data_arr['days_select_mode'] = 'multiple';
134 }
135
136 return $data_arr;
137 }
138
139
140
141 /**
142 * Get JavaScript for Calendar Loading:
143 * 1) Show Calendar
144 * 2) Send Ajax to load bookings / availability / data for calendar
145 *
146 * @param array $params
147 *
148 * @return string Either '' (when collected to footer) OR legacy <script>...</script> fallback.
149 */
150 function wpbc__calendar__load( $params = array() ) {
151
152 $defaults = array(
153 'resource_id' => '1',
154 'aggregate_resource_id_arr' => array(),
155 'selected_dates_without_calendar' => '',
156 'calendar_number_of_months' => 1,
157 'start_month_calendar' => false,
158 'shortcode_options' => '',
159 'custom_form' => 'standard',
160 'calendar_dates_start' => '',
161 'calendar_dates_end' => '',
162 );
163 $params = wp_parse_args( $params, $defaults );
164
165 // Resource ID.
166 $params['resource_id'] = absint( $params['resource_id'] );
167
168 // Build JS BODY (no <script>, no ready wrapper).
169 $js_body = '';
170
171 $js_body .= wpbc__calendar__set_js_params__before_show( $params );
172
173 // Show calendar.
174 $js_body .= " wpbc_calendar_show(" . wp_json_encode( (string) $params['resource_id'] ) . "); ";
175
176 // Security params.
177 $js_body .= " _wpbc.set_secure_param('nonce', " . wp_json_encode( wp_create_nonce( 'wpbc_calendar_load_ajx' . '_wpbcnonce' ) ) . "); ";
178 $js_body .= " _wpbc.set_secure_param('user_id', " . wp_json_encode( (string) wpbc_get_current_user_id() ) . "); ";
179 $js_body .= " _wpbc.set_secure_param('locale', " . wp_json_encode( (string) get_user_locale() ) . "); ";
180
181 // booking_hash (keep legacy GET behavior, sanitized).
182 $get_booking_hash = '';
183 // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
184 if ( isset( $_GET['booking_hash'] ) ) {
185 // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
186 $raw_hash = wp_unslash( $_GET['booking_hash'] );
187 if ( ! is_array( $raw_hash ) ) {
188 $get_booking_hash = sanitize_text_field( (string) $raw_hash );
189 }
190 }
191
192 // Aggregate type.
193 $aggregate_type = 'all';
194 if (
195 ( ! empty( $params['shortcode_options'] ) )
196 && function_exists( 'wpbc_parse_calendar_options__aggregate_param' )
197 ) {
198 $aggregate_type_res = wpbc_parse_calendar_options__aggregate_param( $params['shortcode_options'] );
199 if ( ( ! empty( $aggregate_type_res ) ) && ( ! empty( $aggregate_type_res['type'] ) ) ) {
200 $aggregate_type = (string) $aggregate_type_res['type'];
201 }
202 }
203
204 // request_uri captured on front-end (legacy rationale).
205 $server_request_uri = '';
206 // phpcs:ignore WordPress.Security.NonceVerification.Missing
207 if ( isset( $_SERVER['REQUEST_URI'] ) ) {
208 // phpcs:ignore WordPress.Security.NonceVerification.Missing
209 $server_request_uri = sanitize_text_field( wp_unslash( (string) $_SERVER['REQUEST_URI'] ) );
210 }
211
212 $params_for_request = array(
213 'resource_id' => $params['resource_id'],
214 'booking_hash' => $get_booking_hash,
215 'request_uri' => $server_request_uri,
216 'custom_form' => (string) $params['custom_form'],
217 'aggregate_resource_id_str' => implode( ',', (array) $params['aggregate_resource_id_arr'] ),
218 'aggregate_type' => (string) $aggregate_type,
219 );
220
221 // Send Ajax request to load bookings.
222 $js_body .= " wpbc_calendar__load_data__ajx(" . wp_json_encode( $params_for_request ) . "); ";
223
224 // ---------------------------------------------------------------------
225 // Elementor-safe path: add inline via WP scripts (footer-safe, not in content). // FixIn: 10.14.13.2.
226 // ---------------------------------------------------------------------
227 $can_use_wp_inline = ( ! wp_doing_ajax() );
228
229 if ( $can_use_wp_inline && class_exists( 'WPBC_FE_Assets' ) ) {
230
231 $assets_key = 'wpbc:cal-load:' . intval( $params['resource_id'] ) . ':' . md5( wp_json_encode( $params_for_request ) );
232
233 // Try after main client script first (best), fallback to wpbc_all if needed.
234 $added = WPBC_FE_Assets::add_jq_ready_js_to_wp_script( 'wpbc-main-client', $js_body, $assets_key );
235 if ( ! $added ) {
236 $added = WPBC_FE_Assets::add_jq_ready_js_to_wp_script( 'wpbc_all', $js_body, $assets_key );
237 }
238
239 if ( $added ) {
240 return ''; // Important: nothing inline in the content.
241 }
242 }
243
244 // ---------------------------------------------------------------------
245 // Legacy fallback: return inline <script>...</script> (Works in rare contexts without wp_footer / without assets manager).
246 // ---------------------------------------------------------------------
247 $start_script_code = '<script type="text/javascript"> ' . wpbc_jq_ready_start() . $js_body . wpbc_jq_ready_end() . '</script>';
248
249 return $start_script_code;
250 }
251
252
253
254 /**
255 * Response to Ajax request, about loading calendar data
256 *
257 * @return void
258 */
259 function ajax_WPBC_AJX_CALENDAR_LOAD() { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound
260
261 // Security ------------------------------------------------------------------------------------------------------ // in Ajax Post: 'nonce': _wpbc.get_secure_param( 'nonce' ),
262 $action_name = 'wpbc_calendar_load_ajx' . '_wpbcnonce';
263 $nonce_post_key = 'nonce';
264 if ( wpbc_is_use_nonce_at_front_end() ) { // FixIn: 10.1.1.2.
265 $result_check = check_ajax_referer( $action_name, $nonce_post_key );
266 }
267
268 $user_id = ( isset( $_REQUEST['wpbc_ajx_user_id'] ) ) ? intval( $_REQUEST['wpbc_ajx_user_id'] ) : wpbc_get_current_user_id(); // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
269
270 /**
271 * SQL ---------------------------------------------------------------------------
272 *
273 * in Ajax Post: 'search_params': _wpbc.search_get_all_params()
274 *
275 * Use prefix "search_params", if Ajax sent - $_REQUEST['search_params']['page_num'], $_REQUEST['search_params']['page_items_count'], ...
276 */
277
278 /**
279 * Using this class here only for escaping variables
280 */
281 $user_request = new WPBC_AJX__REQUEST( array(
282 'db_option_name' => 'booking__wpbc_calendar_load__request_params',
283 'user_id' => $user_id,
284 'request_rules_structure' => array(
285 'resource_id' => array( 'validate' => 'd', 'default' => 1 ), // 'digit_or_csd'
286 'booking_hash' => array( 'validate' => 's', 'default' => '' ),
287 'request_uri' => array( 'validate' => 's', 'default' => '' ),
288 'custom_form' => array( 'validate' => 's', 'default' => 'standard' ),
289 'aggregate_resource_id_str' => array( 'validate' => 'digit_or_csd', 'default' => '' ), // Comma separated string of resource ID, which was used in 'aggregate' parameter.
290 'aggregate_type' => array( 'validate' => 's', 'default' => 'all' ), // 'all' | 'bookings_only' // FixIn: 9.8.15.10.
291 'dates_to_check' => array( 'validate' => 'array', 'default' => '' ), // 'all' | 'bookings_only' // FixIn: 9.8.15.10.
292 )
293 )
294 );
295 $request_prefix = 'calendar_request_params';
296 $request_params = $user_request->get_sanitized__in_request__value_or_default( $request_prefix ); // NOT Direct: $_REQUEST['search_params']['resource_id']
297
298
299 // Do Job here !! -------------------------------------------------------------------------------------------------
300
301 make_bk_action( 'check_pending_unpaid_bookings__do_auto_cancel', $request_params['resource_id'] );
302
303 $skip_booking_id = wpbc_get_booking_id__from_hash_in_url( $request_params['booking_hash'] ); // Booking ID ( like 1101 ) to skip in calendar
304 $max_days_count = wpbc_get_max_visible_days_in_calendar(); // 365 - number of visible days
305 // Resource ID from aggregate parameter in booking shortcode!
306 $aggregate_resource_id_arr = explode( ',', $request_params['aggregate_resource_id_str'] );
307 $aggregate_resource_id_arr = array_filter( $aggregate_resource_id_arr ); // All entries of array equal to FALSE (0, '', '0' ) will be removed.
308 $aggregate_resource_id_arr = array_unique( $aggregate_resource_id_arr ); // Remove duplicates // FixIn: 9.8.15.10.
309 if ( ( $resource_id_key = array_search( $request_params['resource_id'], $aggregate_resource_id_arr ) ) !== false ) {
310 unset( $aggregate_resource_id_arr[ $resource_id_key ] ); // Remove source booking resource from aggregate ARR. // FixIn: 9.8.15.10.
311 }
312 $aggregate_resource_id_arr = array_values($aggregate_resource_id_arr); // Reset keys
313
314 $availability_per_days__params = array(
315 'resource_id' => $request_params['resource_id'],
316 'max_days_count' => $max_days_count,
317 'skip_booking_id' => $skip_booking_id,
318 'request_uri' => $request_params['request_uri'], // It different in Ajax requests than $server_request_uri . It's used for change-over days to detect for exception at specific pages
319 'custom_form' => $request_params['custom_form']
320 , 'additional_bk_types' => $aggregate_resource_id_arr // It is array of booking resources from aggregate parameter() // arrays | CSD | int // OPTIONAL
321 , 'aggregate_type' => $request_params['aggregate_type'] // It is string: 'all' | 'bookings_only' // OPTIONAL
322 // , 'as_single_resource' => true // get dates as for 'single resource' or 'parent' resource including bookings in all 'child booking resources'
323 // , 'max_days_count' => wpbc_get_max_visible_days_in_calendar() // 365
324 // , 'timeslots_to_check_intersect' => $timeslots_to_check_intersect //TODO 2023-10-25: delete it, because we get it in wpbc_get_availability_per_days_arr() //array( '12:20 - 12:55', '13:00 - 14:00' )
325 );
326
327 if ( ! empty( $request_params['dates_to_check'] ) ) {
328 $availability_per_days__params['dates_to_check'] = $request_params['dates_to_check']; // Usually if defined it is: [ '2025-01-01', '2025-12-31' ], because of shortcode [booking resource_id=4 calendar_dates_start='2025-01-01' calendar_dates_end='2025-12-31' ...]
329 }
330
331 // If in Booking > Add booking page we use in URL .../wp-admin/admin.php?page=wpbc-new&booking_type=2&as_single_resource=1 then get availability only for single resource.
332 if (
333 ( ! empty( $request_params['request_uri'] ) )
334 && ( strpos( $request_params['request_uri'], 'as_single_resource=1' ) !== false )
335 ){
336 $availability_per_days__params['as_single_resource'] = true;
337 }
338
339 /**
340 * Tricks:
341 * if ( strpos( $request_params['request_uri'],'page=wpbc-new' ) !== false ) { $availability_per_days__params['is_days_always_available'] = true; }
342 *
343 * // Set dates in calendar always available only for specific resources with specific ID
344 * if ( in_array( $request_params['resource_id'], array( 12, 15, 17 ) ) ) { $availability_per_days__params['is_days_always_available'] = true; }
345 */
346
347 // Get unavailable dates for calendar
348 // $availability_per_days__params['dates_to_check'] = array( '2025-01-01', '2025-12-31' ); // FixIn: 10.13.1.4.
349 $availability_per_days_arr = wpbc_get_availability_per_days_arr( $availability_per_days__params );
350
351
352 $ajx_data_arr = array( /**
353 * Send JSON. It will make "wp_json_encode" - so pass only array, and This function call wp_die( '', '', array( 'response' => null, ) ) .
354 * Pass JS OBJ: response_data in "jQuery.post( " function on success.
355 */
356 'ajx_data' => $availability_per_days_arr,
357 // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated, WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
358 'ajx_search_params' => $_REQUEST[ $request_prefix ],
359 'ajx_cleaned_params' => $request_params,
360 'resource_id' => $request_params['resource_id'],
361 );
362
363 // FixIn: 10.12.4.6.
364 if ( ! in_array( $request_params['resource_id'], $availability_per_days_arr['resources_id_arr__in_dates'] ) ) {
365 $ajx_data_arr['ajx_data']['ajx_after_action_message'] = 'Wrong ID of booking resource. Probably calendar (booking resource) with ID = ' . intval( $request_params['resource_id'] ) . ' not exists. Please check resource_id parameter in the Booking Calendar shortcode.';
366 }
367
368
369
370 // Show message under calendar, if needed.
371 //$availability_per_days_arr['ajx_after_action_message'] = 'Ta Da :))';
372 //$availability_per_days_arr['ajx_after_action_message_status'] = 'warning';
373
374 // Ajax ------------------------------------------------------------------------------------------------------------
375 wp_send_json( $ajx_data_arr );
376
377 }
378
379 if ( is_admin() && ( defined( 'DOING_AJAX' ) ) && ( DOING_AJAX ) ) {
380 add_action( 'wp_ajax_nopriv_' . 'WPBC_AJX_CALENDAR_LOAD', 'ajax_' . 'WPBC_AJX_CALENDAR_LOAD' ); // Client (not logged in)
381 add_action( 'wp_ajax_' . 'WPBC_AJX_CALENDAR_LOAD', 'ajax_' . 'WPBC_AJX_CALENDAR_LOAD' ); // Logged In users (or admin panel)
382 }
383
384