react-code-dataset / wp-calypso /apps /wpcom-block-editor /src /wpcom /features /deprecate-coblocks-buttons.js
react-code-dataset / wp-calypso /apps /wpcom-block-editor /src /wpcom /features /deprecate-coblocks-buttons.js
Download wp-calypso/apps/wpcom-block-editor/src/wpcom/features/deprecate-coblocks-buttons.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 589 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/apps/wpcom-block-editor/src/wpcom/features/deprecate-coblocks-buttons.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/apps/wpcom-block-editor/src/wpcom/features/deprecate-coblocks-buttons.js
-
curl -L -o deprecate-coblocks-buttons.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/apps/wpcom-block-editor/src/wpcom/features/deprecate-coblocks-buttons.js
589 Bytes
| 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 ); | |