| 1 |
/** |
| 2 |
* WordPress dependencies |
| 3 |
*/ |
| 4 |
import { registerBlockCollection, setCategories } from '@wordpress/blocks' |
| 5 |
import { Icon } from '@wordpress/components' |
| 6 |
import { select } from '@wordpress/data' |
| 7 |
import { brandBlockIcon } from '@library/components/icons' |
| 8 |
|
| 9 |
/** |
| 10 |
* Register the 'Extendify' block category. |
| 11 |
* |
| 12 |
* Note: The category label is overridden via registerBlockCollection() below. |
| 13 |
*/ |
| 14 |
const currentCategories = select('core/blocks').getCategories() |
| 15 |
setCategories([ |
| 16 |
{ |
| 17 |
slug: 'extendify', |
| 18 |
title: 'Extendify', |
| 19 |
icon: null, |
| 20 |
}, |
| 21 |
...currentCategories, |
| 22 |
]) |
| 23 |
|
| 24 |
/** |
| 25 |
* Function to register a block collection for our block(s). |
| 26 |
*/ |
| 27 |
registerBlockCollection('extendify', { |
| 28 |
title: 'Extendify', |
| 29 |
icon: <Icon icon={brandBlockIcon} />, |
| 30 |
}) |
| 31 |
|