Created
June 8, 2018 16:02
-
-
Save jorgefilipecosta/be3c487d10af57838f90e3227225c6d7 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.blocks; | |
registerBlockType( 'block/inner-block-transforms', { | |
title: 'Test allowedBlocks', | |
icon: 'carrot', | |
category: 'common', | |
edit() { | |
return el( 'div', { style: { outline: '1px solid gray', padding: 5 } }, | |
el( InnerBlocks, { | |
allowedBlocks: [ 'core/list', 'core/quote' ], | |
template: [ | |
[ 'core/image' ], | |
[ 'core/gallery' ], | |
[ '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