Last active
September 23, 2019 07:29
-
-
Save ivo-ivanov/20acb48ca488f4ce9c09cecfd0f0fef5 to your computer and use it in GitHub Desktop.
Create custom Gutenberg category. #wordpress #gutenberg
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
function custom_gutenberg_category( $categories, $post ) { | |
return array_merge( | |
$categories, | |
array( | |
array( | |
'slug' => 'custom', | |
'title' => __( 'Custom', 'custom' ), | |
), | |
) | |
); | |
} | |
add_filter( 'block_categories', 'custom_gutenberg_category', 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment