Custom plugin to manage WordPress blocks.
- Disable unsupported blocks
- Disable or enable blocks to custom post types
In ucla-ioes-blocks.js
unregister block slugs to disable in editor.
If block slug is core/columns
then add unregisterBlockType
wp.blocks.unregisterBlockType( 'core/columns' );
wp.blocks.unregisterBlockType( 'core/latest-comments' );
To find out name of a block slug, view source and get name from data-type element.
Two hooks introduced to WordPress specifically for enqueueing block assets.
enqueue_block_editor_assets
– This can be used to enqueue block scripts and styles in the admin editor only.enqueue_block_assets
– This is used to enqueue block scripts and styles in both the admin editor and frontend of the site.