Skip to content

Instantly share code, notes, and snippets.

@ivo-ivanov
Last active September 23, 2019 07:29
Show Gist options
  • Save ivo-ivanov/20acb48ca488f4ce9c09cecfd0f0fef5 to your computer and use it in GitHub Desktop.
Save ivo-ivanov/20acb48ca488f4ce9c09cecfd0f0fef5 to your computer and use it in GitHub Desktop.
Create custom Gutenberg category. #wordpress #gutenberg
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