<?php
/**
 * Luxury Concept: Block Patterns
 *
 * @since Luxury Concept 1.0
 */

/**
 * Registers block patterns and categories.
 *
 * @since Luxury Concept 1.0
 *
 * @return void
 
 
 * How register a pattern:
 * title (required): A human-readable title for the pattern.
 * content (required): Raw HTML content for the pattern.
 * description: A visually hidden text used to describe the pattern in the inserter. A description is optional but it is strongly encouraged when the title does not fully
 *              describe what the pattern does.
 * categories: A list of pattern categories used to group block patterns. Block patterns can be shown on multiple categories.
 * keywords: Aliases or keywords that help users discover it while searching.
 * viewportWidth: Specify the width of the pattern in the inserter.
 *
 *
 */
function luxuryconceptfree_register_block_patterns() {
	$luxuryconceptfree_block_pattern_categories = array(
		'luxuryconceptfree' => array( 'label' => __( 'Luxury Concept', 'luxuryconceptfree' ) ),

	);

	/**
	 * Filters the theme block pattern categories.
	 *
	 * @since Twenty Twenty-Two 1.0
	 *
	 * @param array[] $block_pattern_categories {
	 *     An associative array of block pattern categories, keyed by category name.
	 *
	 *     @type array[] $properties {
	 *         An array of block category properties.
	 *
	 *         @type string $label A human-readable label for the pattern category.
	 *     }
	 * }
	 */
	$luxuryconceptfree_block_pattern_categories = apply_filters( 'luxuryconceptfree_block_pattern_categories', $luxuryconceptfree_block_pattern_categories );

	foreach ( $luxuryconceptfree_block_pattern_categories as $name => $properties ) {
		if ( ! WP_Block_Pattern_Categories_Registry::get_instance()->is_registered( $name ) ) {
			register_block_pattern_category( $name, $properties );
		}
	}

	$block_patterns = array(
		'buttons',
		'hero-cover',
		'hero-cover2',
		'keypoint',
		'box-features',	
		'faq',
	);

	/**
	 * Filters the theme block patterns.
	 *
	 * @since Twenty Twenty-Two 1.0
	 *
	 * @param array $block_patterns List of block patterns by name.
	 */
	$block_patterns = apply_filters( 'luxuryconceptfree_block_patterns', $block_patterns );

	foreach ( $block_patterns as $block_pattern ) {
		$pattern_file = get_theme_file_path( '/inc/patterns/' . $block_pattern . '.php' );
		register_block_pattern(
			'luxuryconceptfree/' . $block_pattern,
			require $pattern_file
			
		);
	}
}
add_action( 'init', 'luxuryconceptfree_register_block_patterns', 9 );
