Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Register custom Gutenberg block category
<?php
function new_category( $categories, $post ) {
return array_merge(
$categories,
array(
array(
'slug' => 'custom-category',
'title' => __( 'Custom Category', 'language' ),
),
)
);
}
add_filter( 'block_categories', 'new_category', 10, 2);
<?php
add_filter( 'allowed_block_types', 'allowed_block_types' );
function allowed_block_types( $allowed_blocks ) {
return [
'core/image',
'core/paragraph',
'core/heading'
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.