Skip to content

Instantly share code, notes, and snippets.

@jorgefilipecosta
Created August 24, 2018 23:01
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/d3cc0a9937ac1105e0a0537efd0e615b to your computer and use it in GitHub Desktop.
Save jorgefilipecosta/d3cc0a9937ac1105e0a0537efd0e615b to your computer and use it in GitHub Desktop.
( 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