Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function (wp) {
- var el = wp.element.createElement;
- var __ = wp.i18n.__;
- var TextControl = wp.blocks.InspectorControls.TextControl;
- wp.blocks.registerBlockType('shelob9/metatest', {
- title: __('Meta and Markup', 'metatest'),
- category: 'common',
- edit: function (props) {
- return el(
- 'div',
- {},
- [
- el(
- 'p',
- {className: props.className},
- props.attributes.content
- ),
- el(
- TextControl,
- {
- label: __('Content', 'metatest'),
- value: props.attributes.content,
- onChange: function (value) {
- props.setAttributes({content: value});
- }
- },
- )
- ]
- )
- },
- save: function (props) {
- return el(
- 'p',
- {className: props.className},
- props.attributes.content
- );
- }
- });
- })(
- window.wp
- );
Add Comment
Please, Sign In to add comment