Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { __ } from '@wordpress/i18n';
- import { registerBlockType } from '@wordpress/blocks';
- import { InnerBlocks } from '@wordpress/block-editor';
- const TEMPLATE = [ [ 'core/columns' ] ];
- const ALLOWED_BLOCKS = [ 'mt/inner-blocks-wrapper' ];
- const edit = () => (
- <div className="c-layout-column-wrapper is-admin">
- <InnerBlocks template={ TEMPLATE } allowedBlocks={ ALLOWED_BLOCKS } />
- </div>
- );
- const save = () => (
- <div className="c-layout-column-wrapper">
- <InnerBlocks.Content />
- </div>
- );
- registerBlockType( 'mt/layout-columns', {
- title: __( 'Layout Columns', 'layout-columns' ),
- icon: 'universal-access-alt',
- category: 'layout',
- edit,
- save,
- } );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement