函数原型
register_block_pattern_category( string $category_name, array $category_properties ): bool
函数描述
Registers a new pattern category.
是否弃用
未弃用
函数参数
-
$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.More Arguments from WP_Block_Pattern_Categories_Registry::register( … $category_properties )
List of properties for the block pattern category.
labelstringRequired. A human-readable label for the pattern category.
函数返回值
bool True if the pattern category was registered with success and false otherwise.
函数位置
File: wp-includes/class-wp-block-pattern-categories-registry.php.
函数源码
function register_block_pattern_category( $category_name, $category_properties ) {
return WP_Block_Pattern_Categories_Registry::get_instance()->register( $category_name, $category_properties );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 5.5.0 | Introduced. |

