<?php
/**
 * Online Retailer: Block Patterns
 *
 * @since Online Retailer 1.0
 */

/**
 * Registers block patterns and categories.
 *
 * @since Online Retailer 1.0
 *
 * @return void
 */
function online_retailer_register_block_patterns() {
	$online_retailer_block_pattern_categories = array(
		'online-retailer'    => array( 'label' => __( 'Online Retailer', 'online-retailer' ) ),
	);

	$online_retailer_block_pattern_categories = apply_filters( 'online_retailer_block_pattern_categories', $online_retailer_block_pattern_categories );

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