register_block_pattern_category()WP 5.5.0

Registers a new pattern category.

Хуков нет.

Возвращает

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

Использование

register_block_pattern_category( $category_name, $category_properties );
$category_name(строка) (обязательный)
Pattern category name including namespace.
$category_properties(массив) (обязательный)
List of properties for the block pattern. See WP_Block_Pattern_Categories_Registry::register() for accepted arguments.

Список изменений

С версии 5.5.0 Введена.

Код register_block_pattern_category() WP 6.5.2

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