Created
July 11, 2018 16:56
-
-
Save jorgefilipecosta/adccbb67d5bcfb3308d06304b8940648 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/test-layouts', { | |
title: 'Test layouts', | |
icon: 'carrot', | |
category: 'common', | |
edit() { | |
return el( 'div', { style: { outline: '1px solid gray', padding: 5 } }, | |
el( InnerBlocks, { | |
layouts: { | |
normal: { label: 'Normal Width', icon: 'align-center' }, | |
wide: { label: 'Width Width', icon: 'align-wide' }, | |
}, | |
} ) | |
); | |
}, | |
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