Skip to content

Instantly share code, notes, and snippets.

@jorgefilipecosta
Created May 21, 2019 22:15
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/67ca0214c34ae56c3e8446553fdf1e68 to your computer and use it in GitHub Desktop.
Save jorgefilipecosta/67ca0214c34ae56c3e8446553fdf1e68 to your computer and use it in GitHub Desktop.
( function(
blocks,
blockEditor,
element,
data
) {
var el = element.createElement;
var InnerBlocks = blockEditor.InnerBlocks;
blocks.registerBlockType( 'demo/demo-block', {
title: 'Demo',
category: 'common',
attributes: {},
edit: function( props ) {
return el(
'div',
{},
'After:' + data.select('core/editor').getEditedPostAttribute('title'),
);
},
save: function( props ) {
return el(
'div',
{},
'After:' + data.select('core/editor').getEditedPostAttribute('title'),
);
},
} )
} ) (
window.wp.blocks,
window.wp.blockEditor,
window.wp.element,
window.wp.data,
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment