Guest User

Untitled

a guest
Sep 16th, 2020
106
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { __ } from '@wordpress/i18n';
  2. import { registerBlockType } from '@wordpress/blocks';
  3. import { InnerBlocks } from '@wordpress/block-editor';
  4.  
  5. const TEMPLATE = [ [ 'core/columns' ] ];
  6. const ALLOWED_BLOCKS = [ 'mt/inner-blocks-wrapper' ];
  7.  
  8. const edit = () => (
  9.     <div className="c-layout-column-wrapper is-admin">
  10.         <InnerBlocks template={ TEMPLATE } allowedBlocks={ ALLOWED_BLOCKS } />
  11.     </div>
  12. );
  13.  
  14. const save = () => (
  15.     <div className="c-layout-column-wrapper">
  16.         <InnerBlocks.Content />
  17.     </div>
  18. );
  19.  
  20. registerBlockType( 'mt/layout-columns', {
  21.     title: __( 'Layout Columns', 'layout-columns' ),
  22.     icon: 'universal-access-alt',
  23.     category: 'layout',
  24.     edit,
  25.     save,
  26. } );
  27.  
RAW Paste Data