WordPress at a glance
функция не описана

WP_Block_Pattern_Categories_Registry::register() public WP 5.5.0

Registers a pattern category.

It's a method of the class: WP_Block_Pattern_Categories_Registry{}

Хуков нет.

Возвращает

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

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

$WP_Block_Pattern_Categories_Registry = new WP_Block_Pattern_Categories_Registry();
$WP_Block_Pattern_Categories_Registry->register( $category_name, $category_properties );
$category_name(string) (required)
Pattern category name.
$category_properties(array) (required)
Array containing the properties of the category: label.

Changelog

Since 5.5.0 Introduced.

Код WP_Block_Pattern_Categories_Registry::register() WP 5.5.1

<?php
public function register( $category_name, $category_properties ) {
	if ( ! isset( $category_name ) || ! is_string( $category_name ) ) {
		_doing_it_wrong( __METHOD__, __( 'Block pattern category name must be a string.' ), '5.5.0' );
		return false;
	}

	$this->registered_categories[ $category_name ] = array_merge(
		array( 'name' => $category_name ),
		$category_properties
	);

	return true;
}