Created
May 15, 2019 19:39
-
-
Save jorgefilipecosta/00def2c1d6c415120ee00d9b5f004ed7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( 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