Last active
July 9, 2018 16:10
-
-
Save jorgefilipecosta/e6a0cb40f2d26c5f6ab7253b5ed59108 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 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