block-editor-plugin.js 624 B

1234567891011121314151617181920212223
  1. ( function( wp ) {
  2. if ( ! wp ) {
  3. return;
  4. }
  5. wp.plugins.registerPlugin( 'classic-editor-plugin', {
  6. render: function() {
  7. var createElement = wp.element.createElement;
  8. var PluginMoreMenuItem = wp.editPost.PluginMoreMenuItem;
  9. var url = wp.url.addQueryArgs( document.location.href, { 'classic-editor': '', 'classic-editor__forget': '' } );
  10. var linkText = lodash.get( window, [ 'classicEditorPluginL10n', 'linkText' ] ) || 'Switch to Classic Editor';
  11. return createElement(
  12. PluginMoreMenuItem,
  13. {
  14. icon: 'editor-kitchensink',
  15. href: url,
  16. },
  17. linkText
  18. );
  19. },
  20. } );
  21. } )( window.wp );