-
-
Save temperatio/a995003bc72624a4758eb5f675bb2862 to your computer and use it in GitHub Desktop.
Gutenberg: Custom Block Category #gutenberg #wordpress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
registerBlockType( 'loomo/yoshi-cookies', { | |
category: 'mario-blocks', // Block category |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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