create-guten-block icon indicating copy to clipboard operation
create-guten-block copied to clipboard

Add category

Open zkmark opened this issue 5 years ago • 1 comments

Feature Request

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I have an issue when [...]

add category option in init.php

so you can have a category with tab panel

cgb

Describe the solution you'd like A clear and concise description of what you want to happen. Add any considered drawbacks

generated code example init.php //New Category //Categories For Editor add_filter('block_categories', 'cgb_categories', 10, 2); function cgb_categories( $categories, $post ){ return array_merge( $categories, array( array( 'slug' => 'create-guten-block', 'title' => 'Create Guten Blocks', 'icon' => 'awards' ), ) ); } .

in JS registerBlockType( 'cgb/block-zafiro-blocks', { // Block name. Block names must be string that contains a namespace prefix. Example: my-plugin/my-custom-block. title: __( 'CGB Block' ), // Block title. icon: 'shield', // Block icon from Dashicons → https://developer.wordpress.org/resource/dashicons/. category: 'create-guten-block', // THE CATEGORY OF PHP keywords: [ __( 'zafiro-blocks — CGB Block' ), __( 'CGB Example' ), ], }

zkmark avatar Feb 01 '20 21:02 zkmark

I'm not sure I understand your questions, but this is the documentation for adding a Gutenberg block category.

https://developer.wordpress.org/block-editor/developers/filters/block-filters/#managing-block-categories

michaelslevy avatar Mar 12 '20 04:03 michaelslevy