<?php
/**
 * pari: Block Patterns *
 *
 * @package pari
 * @since pari 1.0.0
 */

add_action( 'init', 'pari_remove_core_block_patterns', 9 );
/**
 * Removes core block patterns.
 *
 * @since pari 1.0.0
 *
 * @return void
 */
function pari_remove_core_block_patterns() {
	remove_theme_support( 'core-block-patterns' );
}

/**
 * Registers block patterns and categories. *
 *
 * @since pari 1.0.0
 */
function pari_register_block_patterns() {
	$block_pattern_categories = array(
		'pari' => array( 'label' => __( 'pari', 'pari' ) ),
	);

	$block_pattern_categories = apply_filters( 'pari_block_pattern_categories', $block_pattern_categories );

	foreach ( $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', 'pari_register_block_patterns', 8 );
