Last active
June 28, 2018 09:24
-
-
Save jorgefilipecosta/b958239761a24664685d5efc7ab48fa6 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() { | |
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