Last active
December 17, 2019 09:13
-
-
Save ivo-ivanov/90dbf012d17a82acd1555fd57a706da9 to your computer and use it in GitHub Desktop.
Create custom block category. #wordperss #gutenberg
This file contains hidden or 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
| function custom_block_category( $categories, $post ) { | |
| return array_merge( | |
| $categories, | |
| array( | |
| array( | |
| 'slug' => 'custom', | |
| 'title' => __( 'Custom Blocks', 'custom-blocks' ), | |
| ), | |
| ) | |
| ); | |
| } | |
| add_filter( 'block_categories', 'custom_block_category', 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment