liip / bootstrap-blocks-wordpress-plugin

Bootstrap Gutenberg Blocks for WordPress
https://wordpress.org/plugins/wp-bootstrap-blocks/
279 stars 60 forks source link

Filter to disable button #80

Closed huubl closed 3 years ago

huubl commented 3 years ago

Hi,

I only want to use the container/row/column blocks. What do you think about a filter to disable the button block?

tschortsch commented 3 years ago

Hi @huubl. You should be able to use the WordPress core unregisterBlockType filter to achieve this. See https://developer.wordpress.org/block-editor/reference-guides/filters/block-filters/#using-a-deny-list for the documentation.

huubl commented 3 years ago

Thanks! got it working:

import { unregisterBlockType } from '@wordpress/blocks';
import domReady from '@wordpress/dom-ready';

domReady( function () {
    unregisterBlockType('wp-bootstrap-blocks/button');
} );