<?php
/**
 * Core bootstrap for the CrispyCohd Advanced Accordion Block.
 */

namespace CrispyCohd\AdvancedAccordionBlock;

defined( 'ABSPATH' ) || exit;

final class Accordion {
	/**
	 * Hook plugin logic.
	 */
	public static function init(): void {
		add_action( 'init', [ __CLASS__, 'register_block' ] );
	}

	/**
	 * Register the block from block.json.
	 */
	public static function register_block(): void {
		$block_dir = CRISPYCOHD_AAB_PATH . 'blocks/advanced-accordion';
		if ( file_exists( $block_dir . '/block.json' ) ) {
			register_block_type( $block_dir );
		}
	}
}
