Skip to content

Instantly share code, notes, and snippets.

@jorgefilipecosta
Last active October 8, 2018 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jorgefilipecosta/b733f1745531dc9758c6eba0838ae3f5 to your computer and use it in GitHub Desktop.
Save jorgefilipecosta/b733f1745531dc9758c6eba0838ae3f5 to your computer and use it in GitHub Desktop.
( function() {
var registerBlockType = wp.blocks.registerBlockType;
var el = wp.element.createElement;
registerBlockType( 'test/no-align-default-align', {
title: 'Test No Align and Default Align',
icon: 'cart',
category: 'common',
attributes: {
align: {
type: 'string',
default: 'right',
},
},
supports: {
align: [ 'left', 'center', 'right' ],
},
edit: function( props ) {
return el( 'div', { style: { outline: '1px solid gray', padding: 5 } },
'Test No Align and Default Align Block'
);
},
save: function() {
return el( 'div', { style: { outline: '1px solid gray', padding: 5 } },
'Test No Align and Default Align Block'
);
},
} );
} )();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment