<?php

if (!defined('ABSPATH')) {
    exit;
}

require_once __DIR__ . '/helpers.php';
require_once __DIR__ . '/roles.php';
require_once __DIR__ . '/cpt.php';
require_once __DIR__ . '/meta.php';
require_once __DIR__ . '/settings.php';
require_once __DIR__ . '/booking.php';
require_once __DIR__ . '/emails.php';
require_once __DIR__ . '/admin.php';
require_once __DIR__ . '/frontend.php';
require_once __DIR__ . '/rest.php';
require_once __DIR__ . '/assets.php';

function chbk_bootstrap()
{
    chbk_register_roles();
    chbk_register_meta();
    chbk_register_settings();
    chbk_register_admin_pages();
    chbk_register_shortcodes();
    chbk_register_rest_routes();
}

function chbk_activate_core()
{
    chbk_register_roles();
    chbk_register_cpts();
    flush_rewrite_rules();

    if (false === get_option('chbk_settings')) {
        add_option('chbk_settings', chbk_get_default_settings());
    }
}

function chbk_deactivate_core()
{
    flush_rewrite_rules();
}
