PluginProbe
Booking Calendar / 10.1.3
Booking Calendar v10.1.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 / includes / page-availability / availability__activation.php

availability__activation.php in Booking Calendar 10.1.3, at includes/page-availability/availability__activation.php

55 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @version 1.0
4 * @package Booking Calendar
5 * @category A c t i v a t e & D e a c t i v a t e
6 * @author wpdevelop
7 *
8 * @web-site https://wpbookingcalendar.com/
9 * @email info@wpbookingcalendar.com
10 * @modified 2022-11-23
11 *
12 */
13
14 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
15
16
17 /**
18 * A c t i v a t e - Create new DB Table, for booking dates properties
19 *
20 * booking date property can be relative to: prop_name = 'unavailable', 'available', 'rate', 'allow_start_day_selection', 'allow_days_number_to_select', 'availability_count', ...
21 *
22 * ?: prop_name = 'date_status' -> prop_value = 'unavailable', 'available', 'pending', 'approved'
23 *
24 * @return void
25 */
26 function wpbc_activation__dates_availability() { //FixIn: 9.3.1.2
27
28 global $wpdb;
29 $charset_collate = ( ! empty( $wpdb->charset ) ) ? "DEFAULT CHARACTER SET $wpdb->charset" : '';
30 $charset_collate .= ( ! empty( $wpdb->collate ) ) ? " COLLATE $wpdb->collate" : '';
31
32 if ( ! wpbc_is_table_exists( 'booking_dates_props' ) ) {
33 $simple_sql = "CREATE TABLE {$wpdb->prefix}booking_dates_props (
34 booking_dates_prop_id bigint(20) unsigned NOT NULL auto_increment,
35 resource_id bigint(10) NOT NULL default 1,
36 calendar_date datetime NOT NULL default '0000-00-00 00:00:00',
37 prop_name varchar(200) NOT NULL default '',
38 prop_value text,
39 PRIMARY KEY (booking_dates_prop_id)
40 ) {$charset_collate}";
41 $wpdb->query( $simple_sql );
42 }
43 }
44 add_bk_action( 'wpbc_activation_after_db_actions', 'wpbc_activation__dates_availability' );
45
46
47 /**
48 * D e a c t i v a t e
49 */
50 function wpbc_deactivation__dates_availability() {
51
52 global $wpdb;
53 $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}booking_dates_props" );
54 }
55 add_bk_action( 'wpbc_other_versions_deactivation', 'wpbc_deactivation__dates_availability' );