function __construct() { global $wpdb; $this->db =& $wpdb; $installed_build = SPBCommon::get_option('staypress_booking_build', false); if ($installed_build === false) { $installed_build = $this->build; // Create the property class and force table creation $this->booking = new booking_model($wpdb, 0); SPBCommon::update_option('staypress_booking_build', $installed_build); } else { // Create the property class and send through installed build version $this->booking = new booking_model($wpdb, $installed_build); } $tz = get_option('gmt_offset'); $this->booking->set_timezone($tz); add_action('plugins_loaded', array(&$this, 'load_textdomain')); add_action('init', array(&$this, 'initialise_booking')); add_action('init', array(&$this, 'initialise_bookingadmin_ajax')); add_action('admin_bar_menu', array(&$this, 'add_wp_admin_menu_actions'), 46); do_action('staypress_modify_booking_plugin_actions'); }
function update_booking_options() { global $action, $page; wp_reset_vars(array('action', 'page')); if (isset($action) && $action == 'updateoptions') { check_admin_referer('update-booking-options'); $options = array(); $options['checkintext'] = $_POST['checkintext']; $options['checkouttext'] = $_POST['checkouttext']; SPBCommon::update_option('sp_booking_options', $options); wp_safe_redirect(add_query_arg('msg', 1, wp_get_referer())); } }