Guest User

Untitled

a guest
May 22nd, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. var Fragment = wp.element.Fragment;
  2. var el = wp.element.createElement;
  3. var __ = wp.i18n.__;
  4. var registerPlugin = wp.plugins.registerPlugin;
  5. var PluginPostPublishPanel = wp.editPost.PluginPostPublishPanel;
  6. var PluginPrePublishPanel = wp.editPost.PluginPrePublishPanel;
  7.  
  8. function PanelContent() {
  9. return (
  10. el(
  11. 'p', {}, __( 'Here is the panel content!' ),
  12. )
  13. );
  14. };
  15.  
  16. function MyPublishPlugin() {
  17. return (
  18. el( Fragment, {},
  19. el(
  20. PluginPrePublishPanel,
  21. {
  22. title: __( 'My pre publish panel' )
  23. },
  24. el( PanelContent, {} )
  25. ),
  26. el(
  27. PluginPostPublishPanel,
  28. {
  29. title: __( 'My post publish panel' )
  30. },
  31. el( PanelContent, {} )
  32. )
  33. )
  34. );
  35. };
  36.  
  37. registerPlugin( 'my-publish-plugin', {
  38. icon: 'welcome-write-blog',
  39. render: MyPublishPlugin
  40. } );
Add Comment
Please, Sign In to add comment