define_constants(); $this->init_plugin(); } /** * Define plugin constants. */ private function define_constants() { define('ACCORD_BLOCKS_VERSION', '1.0.1'); define('ACCORD_BLOCKS_DIR', plugin_dir_path(__FILE__)); define('ACCORD_BLOCKS_URL', plugin_dir_url(__FILE__)); } /** * Initialize plugin functionality. */ private function init_plugin() { // Include Main class if (!class_exists('\AccordBlocks\Inc\Main')) { require_once ACCORD_BLOCKS_DIR . 'Inc/Main.php'; } // Initialize the Main class if (class_exists('\AccordBlocks\Inc\Main')) { \AccordBlocks\Inc\Main::get_instance(); } else { add_action('admin_notices', function () { echo '

'; esc_html_e('Accord Blocks: Required class could not be loaded.', 'accord-blocks'); echo '

'; }); } } } // Kick off the plugin if (class_exists('\AccordBlocks\Accord_Blocks')) { \AccordBlocks\Accord_Blocks::get_instance(); }