Created
December 12, 2018 21:15
-
-
Save awakekat/480430427d86d1f49e9edee8170c20af to your computer and use it in GitHub Desktop.
ESNext
This file contains hidden or 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
const { __, setLocaleData } = wp.i18n; | |
const { registerBlockType } = wp.blocks; | |
const blockStyle = { | |
backgroundColor: '#900', | |
color: '#fff', | |
padding: '20px', | |
}; | |
setLocaleData( window.gutenberg_examples_01_esnext.localeData, 'gutenberg-examples' ); | |
registerBlockType( 'gutenberg-examples/example-01-basic-esnext', { | |
title: __( 'Example: Basic (esnext)', 'gutenberg-examples' ), | |
icon: 'universal-access-alt', | |
category: 'layout', | |
edit() { | |
return <div style={ blockStyle }>Basic example with JSX! (editor)</div>; | |
}, | |
save() { | |
return <div style={ blockStyle }>Basic example with JSX! (front)</div>; | |
}, | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment