register_block_pattern_category()WP 5.5.0

Registers a new pattern category.

No Hooks.

Return

true|false. True if the pattern category was registered with success and false otherwise.

Usage

register_block_pattern_category( $category_name, $category_properties );
$category_name(string) (required)
Pattern category name including namespace.
$category_properties(array) (required)
List of properties for the block pattern. See WP_Block_Pattern_Categories_Registry::register() for accepted arguments.

Changelog

Since 5.5.0 Introduced.

register_block_pattern_category() code WP 6.1.1

function register_block_pattern_category( $category_name, $category_properties ) {
	return WP_Block_Pattern_Categories_Registry::get_instance()->register( $category_name, $category_properties );
}