You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
624 B

1 year ago
  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 );