Guest User

Untitled

a guest
Feb 23rd, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. (function (wp) {
  2. var el = wp.element.createElement;
  3. var __ = wp.i18n.__;
  4. var TextControl = wp.blocks.InspectorControls.TextControl;
  5.  
  6. wp.blocks.registerBlockType('shelob9/metatest', {
  7. title: __('Meta and Markup', 'metatest'),
  8. category: 'common',
  9. edit: function (props) {
  10. return el(
  11. 'div',
  12. {},
  13. [
  14. el(
  15. 'p',
  16. {className: props.className},
  17. props.attributes.content
  18. ),
  19. el(
  20. TextControl,
  21. {
  22. label: __('Content', 'metatest'),
  23. value: props.attributes.content,
  24. onChange: function (value) {
  25. props.setAttributes({content: value});
  26. }
  27. },
  28. )
  29. ]
  30. )
  31.  
  32. },
  33. save: function (props) {
  34. return el(
  35. 'p',
  36. {className: props.className},
  37. props.attributes.content
  38. );
  39. }
  40. });
  41. })(
  42. window.wp
  43. );
Add Comment
Please, Sign In to add comment