. */ namespace ABTestingForWP; if (!defined('ABSPATH')) { header('Status: 403 Forbidden'); header('HTTP/1.1 403 Forbidden'); exit; } require __DIR__ . '/vendor/autoload.php'; function bootstrap() { // only on admin if(is_admin()) { if(!defined('DOING_AJAX') || !DOING_AJAX) { new AdminPage(__FILE__); } } // only on frontend if(!is_admin()) { new RegisterRenderScripts(__FILE__); new RegisterFrontendAdminBar(__FILE__); } // on every request new RegisterGutenbergBlocks(__FILE__); } function bootstrapREST() { new RegisterREST(); } // register WordPress hooks new Installer(__FILE__); add_action('init', 'ABTestingForWP\\bootstrap'); add_action('rest_api_init', 'ABTestingForWP\\bootstrapREST');