Skip to content

Instantly share code, notes, and snippets.

@jorgefilipecosta
Last active June 28, 2018 09:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jorgefilipecosta/b958239761a24664685d5efc7ab48fa6 to your computer and use it in GitHub Desktop.
Save jorgefilipecosta/b958239761a24664685d5efc7ab48fa6 to your computer and use it in GitHub Desktop.
( function() {
const { registerBlockType } = wp.blocks;
const { createElement: el } = wp.element;
const { InnerBlocks } = wp.editor;
registerBlockType( 'block/inner-block-transforms', {
title: 'Test transforms',
icon: 'carrot',
category: 'common',
edit() {
return el( 'div', { style: { outline: '1px solid gray', padding: 5 } },
el( InnerBlocks, {
allowedBlocks: [ 'core/list', 'core/quote' ],
template: [
[ 'core/paragraph' ],
[ 'core/quote' ],
[ 'core/heading' ],
[ 'core/list' ],
],
} )
);
},
save() {
return el( 'div', { style: { outline: '1px solid gray', padding: 5 } },
el( InnerBlocks.Content )
);
},
} );
} )();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment