public function __construct($parent)
 {
     $id = add_submenu_page($parent, __("Get Started", eab_domain()), __("Get started", eab_domain()), 'manage_options', 'eab_welcome', array($this, 'render'));
     $eab = events_and_bookings();
     $this->_data = $eab->_data;
     $this->_api = $eab->_api;
 }
 public function __construct($parent)
 {
     $id = add_submenu_page($parent, __("Event Settings", eab_domain()), __("Settings", eab_domain()), 'manage_options', 'eab_settings', array($this, 'render'));
     add_action('load-' . $id, array($this, 'load'));
     $eab = events_and_bookings();
     $this->_data = $eab->_data;
     $this->_api = $eab->_api;
 }
    define('EAB_OLD_EVENTS_EXPIRY_LIMIT', 100, true);
}
if (!defined('EAB_MAX_UPCOMING_EVENTS')) {
    define('EAB_MAX_UPCOMING_EVENTS', 500, true);
}
require_once EAB_PLUGIN_DIR . 'lib/class_eab_error_reporter.php';
Eab_ErrorReporter::serve();
require_once EAB_PLUGIN_DIR . 'lib/class_eab_options.php';
require_once EAB_PLUGIN_DIR . 'lib/class_eab_collection.php';
require_once EAB_PLUGIN_DIR . 'lib/class_eab_codec.php';
require_once EAB_PLUGIN_DIR . 'lib/class_eab_event_model.php';
require_once EAB_PLUGIN_DIR . 'lib/class_eab_template.php';
require_once EAB_PLUGIN_DIR . 'lib/class_eab_api.php';
require_once EAB_PLUGIN_DIR . 'lib/class-eab-taxonomies.php';
// Lets get things started
$__booking = events_and_bookings();
// @TODO: Refactor
require_once EAB_PLUGIN_DIR . 'lib/class_eab_network.php';
Eab_Network::serve();
require_once EAB_PLUGIN_DIR . 'lib/class_eab_shortcodes.php';
Eab_Shortcodes::serve();
require_once EAB_PLUGIN_DIR . 'lib/class_eab_scheduler.php';
Eab_Scheduler::serve();
require_once EAB_PLUGIN_DIR . 'lib/class_eab_addon_handler.php';
Eab_AddonHandler::serve();
require_once EAB_PLUGIN_DIR . 'lib/default_filters.php';
if (is_admin()) {
    require_once EAB_PLUGIN_DIR . 'lib/class_eab_admin_tutorial.php';
    Eab_AdminTutorial::serve();
    require_once dirname(__FILE__) . '/lib/contextual_help/class_eab_admin_help.php';
    Eab_AdminHelp::serve();
 function handle_attendance_add()
 {
     $eab = events_and_bookings();
     $data = stripslashes_deep($_POST);
     $email = $data['user'];
     $status = $data['status'];
     $post_id = (int) $data['post_id'];
     $allowed = array(Eab_EventModel::BOOKING_YES, Eab_EventModel::BOOKING_NO, Eab_EventModel::BOOKING_MAYBE);
     $post = get_post($post_id);
     if (is_email($email) && $post_id && in_array($status, $allowed)) {
         $user = get_user_by('email', $email);
         if ($user && !empty($user->ID)) {
             $event = new Eab_EventModel($post);
             $event->add_attendance($user->ID, $status);
         }
     }
     echo $eab->meta_box_part_bookings($post);
     die;
 }