Skip to content

Instantly share code, notes, and snippets.

@jorgefilipecosta
Created May 15, 2019 19:39
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/00def2c1d6c415120ee00d9b5f004ed7 to your computer and use it in GitHub Desktop.
Save jorgefilipecosta/00def2c1d6c415120ee00d9b5f004ed7 to your computer and use it in GitHub Desktop.
( function(
blocks,
blockEditor,
element,
) {
var el = element.createElement;
var InnerBlocks = blockEditor.InnerBlocks;
blocks.registerBlockType( 'demo/inner-blocks', {
title: 'Inner Blocks Demo',
category: 'common',
attributes: {},
edit: function( props ) {
return el(
'div',
{},
'Before the inner block:',
el( 'div', { style: { border: '2px solid red' } }, el( InnerBlocks ) ),
'After the inner block:'
);
},
save: function( props ) {
return el(
'div',
{},
'Before the inner block:',
el( 'div', { style: { border: '2px solid red' } }, el( InnerBlocks.Content ) ),
'After the inner block:'
);
},
} )
} ) (
window.wp.blocks,
window.wp.blockEditor,
window.wp.element,
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment