File size: 589 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { getBlockType, registerBlockType, unregisterBlockType } from '@wordpress/blocks';
import domReady from '@wordpress/dom-ready';

/**
 * Prevents the CoBlocks Buttons block from being insertable.
 */
function deprecateCoBlocksButtonsSettings() {
	const coBlocksButtons = getBlockType( 'coblocks/buttons' );
	if ( ! coBlocksButtons ) {
		return;
	}

	unregisterBlockType( 'coblocks/buttons' );
	registerBlockType( 'coblocks/buttons', {
		...coBlocksButtons,
		supports: {
			...coBlocksButtons.supports,
			inserter: false,
		},
	} );
}

domReady( deprecateCoBlocksButtonsSettings );