Skip to main content
update because of WP 5.8 deprecation
Source Link
bueltge
  • 17.1k
  • 7
  • 61
  • 97

Digging myself deeper in documentation, I got the following result.

There is a way to group your custom blocks around a given category in Gutenberg, and therefore we have the method block_categories_allblock_categories_all. So with a filter, you can extend the default categories with custom ones.

Here is my example:

add_filter( 'block_categories_all', function( $categories, $post ) {
    return array_merge(
        $categories,
        array(
            array(
                'slug'  => 'my-slug',
                'title' => 'my-title',
            ),
        )
    );
}, 10, 2 );

You can find more on this in the provided API.

Digging myself deeper in documentation I got the following result.

There is a way to group your custom blocks around a given category in Gutenberg, and therefore we have the method block_categories_all. So with a filter you can extend the default categories with custom ones.

Here is my example:

add_filter( 'block_categories_all', function( $categories, $post ) {
    return array_merge(
        $categories,
        array(
            array(
                'slug'  => 'my-slug',
                'title' => 'my-title',
            ),
        )
    );
}, 10, 2 );

You can find more on this in the provided API.

Digging myself deeper in documentation, I got the following result.

There is a way to group your custom blocks around a given category in Gutenberg, and therefore we have the method block_categories_all. So with a filter, you can extend the default categories with custom ones.

Here is my example:

add_filter( 'block_categories_all', function( $categories, $post ) {
    return array_merge(
        $categories,
        array(
            array(
                'slug'  => 'my-slug',
                'title' => 'my-title',
            ),
        )
    );
}, 10, 2 );

You can find more on this in the provided API.

Digging myself deeper in documentation I got the following result.

There is a way to group your custom blocks around a given category in Gutenberg, and therefore we have the method block_categoriesblock_categories_all. So with a filter you can extend the default categories with custom ones.

Here is my example:

add_filter( 'block_categories''block_categories_all', function( $categories, $post ) {
    return array_merge(
        $categories,
        array(
            array(
                'slug'  => 'my-slug',
                'title' => 'my-title',
            ),
        )
    );
}, 10, 2 );

You can find more on this in the provided API.

Digging myself deeper in documentation I got the following result.

There is a way to group your custom blocks around a given category in Gutenberg, and therefore we have the method block_categories. So with a filter you can extend the default categories with custom ones.

Here is my example:

add_filter( 'block_categories', function( $categories, $post ) {
    return array_merge(
        $categories,
        array(
            array(
                'slug'  => 'my-slug',
                'title' => 'my-title',
            ),
        )
    );
}, 10, 2 );

You can find more on this in the provided API.

Digging myself deeper in documentation I got the following result.

There is a way to group your custom blocks around a given category in Gutenberg, and therefore we have the method block_categories_all. So with a filter you can extend the default categories with custom ones.

Here is my example:

add_filter( 'block_categories_all', function( $categories, $post ) {
    return array_merge(
        $categories,
        array(
            array(
                'slug'  => 'my-slug',
                'title' => 'my-title',
            ),
        )
    );
}, 10, 2 );

You can find more on this in the provided API.

light grammar touchup
Source Link
Pat J
  • 12.3k
  • 2
  • 28
  • 36

Digging myself deeper in documentation I got the following result.

thereThere is a way to group your custom blocks around a given category in Gutenberg, and therefore we have the method block_categories and. So with a filter you can extend the default categories with custom ones.

hereHere is my example:

add_filter( 'block_categories', function( $categories, $post ) {
    return array_merge(
        $categories,
        array(
            array(
                'slug'  => 'my-slug',
                'title' => 'my-title',
            ),
        )
    );
}, 10, 2 );

You can find more on this you can find in the provided API 1the provided API.

Digging myself deeper in documentation I got the following result

there is a way to group your custom blocks around a given category in Gutenberg and therefore we have the method block_categories and with a filter you can extend the default categories with custom ones

here is my example

add_filter( 'block_categories', function( $categories, $post ) {
    return array_merge(
        $categories,
        array(
            array(
                'slug'  => 'my-slug',
                'title' => 'my-title',
            ),
        )
    );
}, 10, 2 );

more on this you can find in the provided API 1

Digging myself deeper in documentation I got the following result.

There is a way to group your custom blocks around a given category in Gutenberg, and therefore we have the method block_categories. So with a filter you can extend the default categories with custom ones.

Here is my example:

add_filter( 'block_categories', function( $categories, $post ) {
    return array_merge(
        $categories,
        array(
            array(
                'slug'  => 'my-slug',
                'title' => 'my-title',
            ),
        )
    );
}, 10, 2 );

You can find more on this in the provided API.

Source Link
fefe
  • 894
  • 3
  • 14
  • 34
Loading