Core Function
View Source on Trac ↗ get_block_categories()
get_block_categories( mixed $post_or_block_editor_context ) Returns all the categories for block types that will be shown in the block editor.
Parameters 1 required
| Name / Type | Description |
|---|---|
| mixed | (WP_Post | WP_Block_Editor_Context) $post_or_block_editor_context The current post object or the block editor context. Required |
Return Value
(array[])
Array of categories for block types.
Function Information
Since Version
5.0.0
Source File
wp-includes/block-editor.php
Advertisement