On this page
get_default_block_categories(): array[]
Returns the list of default categories for block types.
Return
array[] Array of categories for block types.
Source
File: wp-includes/block-editor.php. View all references
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,
),
);
}
Related
Uses
| Uses | Description |
|---|---|
| _x() wp-includes/l10n.php | Retrieves translated string with gettext context. |
Used By
| Used By | Description |
|---|---|
| get_default_block_editor_settings() wp-includes/block-editor.php | Returns the default block editor settings. |
| get_block_categories() wp-includes/block-editor.php | Returns all the categories for block types that will be shown in the block editor. |
Changelog
| Version | Description |
|---|---|
| 5.8.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_default_block_categories