Skip to content

Instantly share code, notes, and snippets.

@jorgefilipecosta
Created August 30, 2018 17:50
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/786b534ab2d4432227d9adc346eb5ad2 to your computer and use it in GitHub Desktop.
Save jorgefilipecosta/786b534ab2d4432227d9adc346eb5ad2 to your computer and use it in GitHub Desktop.
( function() {
var registerBlockType = wp.blocks.registerBlockType;
var el = wp.element.createElement;
registerBlockType( 'test/wide-align', {
title: 'Test Wide Align',
icon: 'cart',
category: 'common',
attributes: {
align: {
type: 'string',
default: 'wide',
},
},
supports: {
align: [ 'wide', 'full', 'center' ],
},
edit: function( props ) {
return el( 'div', { style: { outline: '1px solid gray', padding: 5 } },
'Test Wide Align Block'
);
},
save: function() {
return el( 'div', { style: { outline: '1px solid gray', padding: 5 } },
'Test Wide Align Block'
);
},
} );
} )();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment