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

function magazine_blocks_register_block_patterns() {
	$magazine_blocks_block_pattern_categories = array(
		'magazine-blocks' => array( 'label' => esc_html__( 'Magazine Blocks', 'magazine-blocks' ) ),
		'pages' => array( 'label' => esc_html__( 'Pages', 'magazine-blocks' ) ),
	);

	$magazine_blocks_block_pattern_categories = apply_filters( 'magazine_blocks_magazine_blocks_block_pattern_categories', $magazine_blocks_block_pattern_categories );

	foreach ( $magazine_blocks_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', 'magazine_blocks_register_block_patterns', 9 );