Skip to content

Instantly share code, notes, and snippets.

View retrofox's full-sized avatar
🦊
🪞

Damián Suárez retrofox

🦊
🪞
View GitHub Profile
@mtias
mtias / block.js
Created June 23, 2017 18:11
Creating a Gutenberg block from the console.
var el = wp.element.createElement;
wp.blocks.registerBlockType( 'mytheme/block', {
title: 'Red Block',
icon: 'universal-access-alt',
category: 'layout',
edit: function() {
return el( 'div', { style: { backgroundColor: '#900', color: '#fff', padding: '20px' } }, 'I am a red block.' );
},
save: function() {