get_default_block_categories() WordPress Function
The get_default_block_categories() function is used to get the default block categories. This function is used by the block editor to populate the default set of categories for new blocks.
get_default_block_categories() #
Returns the list of default categories for block types.
Return
(array[]) Array of categories for block types.
Source
File: wp-includes/block-editor.php
function get_default_block_categories() {
return array(
array(
'slug' => 'text',
'title' => _x( 'Text', 'block category' ),
'icon' => null,
),
array(
'slug' => 'media',
'title' => _x( 'Media', 'block category' ),
'icon' => null,
),
array(
'slug' => 'design',
'title' => _x( 'Design', 'block category' ),
'icon' => null,
),
array(
'slug' => 'widgets',
'title' => _x( 'Widgets', 'block category' ),
'icon' => null,
),
array(
'slug' => 'theme',
'title' => _x( 'Theme', 'block category' ),
'icon' => null,
),
array(
'slug' => 'embed',
'title' => _x( 'Embeds', 'block category' ),
'icon' => null,
),
array(
'slug' => 'reusable',
'title' => _x( 'Reusable Blocks', 'block category' ),
'icon' => null,
),
);
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 5.8.0 | Introduced. |