Created
August 24, 2018 23:01
-
-
Save jorgefilipecosta/d3cc0a9937ac1105e0a0537efd0e615b 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() { | |
var registerBlockType = wp.blocks.registerBlockType; | |
var el = wp.element.createElement; | |
registerBlockType( 'test/align', { | |
title: 'Test Align', | |
icon: 'cart', | |
category: 'common', | |
attributes: { | |
align: { | |
type: 'string', | |
default: 'right', | |
}, | |
}, | |
supports: { | |
align: true, | |
}, | |
edit: function( props ) { | |
return el( 'div', { style: { outline: '1px solid gray', padding: 5 } }, | |
'Test Align Block' | |
); | |
}, | |
save: function() { | |
return el( 'div', { style: { outline: '1px solid gray', padding: 5 } }, | |
'Test Align Block' | |
); | |
}, | |
} ); | |
} )(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment