<?php
/**
 * Block Patterns
 *
 * @package circus_fair
 * @since 1.0
 */

function circus_fair_register_block_patterns() {
	$circus_fair_block_pattern_categories = array(
		'circus-fair' => array( 'label' => esc_html__( 'Circus Fair', 'circus-fair' ) ),
		'pages' => array( 'label' => esc_html__( 'Pages', 'circus-fair' ) ),
	);

	$circus_fair_block_pattern_categories = apply_filters( 'circus_fair_circus_fair_block_pattern_categories', $circus_fair_block_pattern_categories );

	foreach ( $circus_fair_block_pattern_categories as $name => $properties ) {
		if ( ! WP_Block_Pattern_Categories_Registry::get_instance()->is_registered( $name ) ) {
			register_block_pattern_category( $name, $properties );
		}
	}
}
add_action( 'init', 'circus_fair_register_block_patterns', 9 );