HTTP/2 301
server: nginx
date: Fri, 26 Dec 2025 11:14:57 GMT
content-type: text/html; charset=UTF-8
x-olaf: ⛄
vary: accept, content-type
x-redirect-by: WordPress
location: https://developer.wordpress.org/reference/functions/register_block_pattern_category/
x-frame-options: SAMEORIGIN
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 2
HTTP/2 200
server: nginx
date: Fri, 26 Dec 2025 11:14:58 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
x-olaf: ⛄
vary: accept, content-type
link:
; rel="https://api.w.org/"
link:
; rel="alternate"; title="JSON"; type="application/json"
link: ; rel=shortlink
x-frame-options: SAMEORIGIN
content-encoding: gzip
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 2
register_block_pattern_category() – Function | Developer.WordPress.org
WordPress Developer Resources
register_block_pattern_category()
register_block_pattern_category( string $category_name, array $category_properties ): bool
Registers a new pattern category.
$category_namestringrequiredPattern category name including namespace.
$category_propertiesarrayrequired
bool True if the pattern category was registered with success and false otherwise.
function register_block_pattern_category( $category_name, $category_properties ) {
return WP_Block_Pattern_Categories_Registry::get_instance()->register( $category_name, $category_properties );
}
View all references View on Trac View on GitHub
| Version | Description |
|---|
| 5.5.0 | Introduced. |
To get the list of all registered categories, paste into the js inspector:
Example from Block Editor Handbook:
These categories already exist in core as of 5.5.1:
Another way to register custom block category with init hook
From Block editor handbook:
register_block_pattern_category()should be called from a handler attached to the init hook.