load_files(); } /** * Initialize the plugin */ public static function init() { static $instance = false; if ( ! $instance ) { $instance = new self(); } return $instance; } /** * Load Plugin Files */ public function load_files() { require_once __DIR__ . '/admin/api.php'; if ( is_admin() ) { require_once __DIR__ . '/admin/settings.php'; } /** * Generator Class * All the generator functions are here for API calls * * @since 1.5.0 */ require_once __DIR__ . '/inc/class-generator.php'; new BDT_AI_IMG\Generator(); } /** * Blocks Registration */ public function register_block( $name, $options = array() ) { register_block_type( __DIR__ . '/build/blocks/' . $name, $options ); } /** * Blocks Initialization */ public function blocks_init() { // register single block $this->register_block( 'image-generator' ); } /** * Register Block Category */ public function register_block_category( $categories, $post ) { return array_merge( array( array( 'slug' => 'ai-image', 'title' => __( 'Ai image', 'ai-image' ), ), ), $categories, ); } } /** * Kickoff */ BDTHEMES_AI_IMAGE::init();