Skip to content

Instantly share code, notes, and snippets.

@lkhedlund
Last active June 18, 2020 08:30
Show Gist options
  • Save lkhedlund/70c35cdd46670373af2b6af2751d5020 to your computer and use it in GitHub Desktop.
Save lkhedlund/70c35cdd46670373af2b6af2751d5020 to your computer and use it in GitHub Desktop.
Gutenberg: Custom Block Category
registerBlockType( 'loomo/yoshi-cookies', {
category: 'mario-blocks', // Block category
<?php
function my_mario_block_category( $categories, $post ) {
return array_merge(
$categories,
array(
array(
'slug' => 'mario-blocks',
'title' => __( 'Mario Blocks', 'mario-blocks' ),
),
)
);
}
add_filter( 'block_categories', 'my_mario_block_category', 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment