<?php
/**
 *
 * @wordpress-plugin
 * Plugin Name:       Alpha Blocks
 * Plugin URI:        https://github.com/robiulawal40
 * Description:       Alpha Blocks adds a variety of customizable Gutenberg blocks to your WordPress site, helping you create modern, responsive content layouts    easily and efficiently—no coding required.
 * Version:           1.5.0
 * Author:            Robiul Awal
 * Author URI:        https://www.linkedin.com/company/wp-codezen
 * License:           GPL-2.0+
 * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
 * Text Domain:       alpha
 * Domain Path:       /languages
 */

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

if ( ! defined( 'ALPHA_PLUGIN_FILE' ) ) {
	define( 'ALPHA_PLUGIN_FILE', __FILE__ );
}

// Include the main Alpha_Blocks_Final class.
if ( ! class_exists( 'Alpha_Blocks_Final', false ) ) {
	include_once dirname( ALPHA_PLUGIN_FILE ) . '/includes/class-alpha-blocks.php';
}

/**
 * Initialization of the plugin.
 * Gutenberg is required
 *
 * @Gutenberg
 *
 * @return object
 */
function Alpha_init() {
	return Alpha_Blocks_Final::instance();
}

$GLOBALS['alpha_blocks'] = Alpha_init();

new ALPHA_i18n();
new ALPHA_enqueue_scripts();
new ALPHA_upload_image_handler();
new ALPHA_Block_Category();
new ALPHA_Blocks_API();
new ALPHA_Block_Inline_Style();


function alpha_blocks_register_blocks() {
	register_block_type( __DIR__ . '/build/accordion' );
	register_block_type( __DIR__ . '/build/accordion-item' );
	register_block_type( __DIR__ . '/build/hero' );
	register_block_type( __DIR__ . '/build/heading' );
	register_block_type( __DIR__ . '/build/image' );
	register_block_type( __DIR__ . '/build/icon' );
	register_block_type( __DIR__ . '/build/columns' );
	register_block_type( __DIR__ . '/build/column' );
	register_block_type( __DIR__ . '/build/button' );
	register_block_type( __DIR__ . '/build/buttons' );
	register_block_type( __DIR__ . '/build/text' );
}
add_action( 'init', 'alpha_blocks_register_blocks' );
