diff options
Diffstat (limited to 'plugins/classic-editor/js/block-editor-plugin.js')
-rw-r--r-- | plugins/classic-editor/js/block-editor-plugin.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/plugins/classic-editor/js/block-editor-plugin.js b/plugins/classic-editor/js/block-editor-plugin.js new file mode 100644 index 00000000..5b365974 --- /dev/null +++ b/plugins/classic-editor/js/block-editor-plugin.js @@ -0,0 +1,23 @@ +( function( wp ) { + if ( ! wp ) { + return; + } + + wp.plugins.registerPlugin( 'classic-editor-plugin', { + render: function() { + var createElement = wp.element.createElement; + var PluginMoreMenuItem = wp.editPost.PluginMoreMenuItem; + var url = wp.url.addQueryArgs( document.location.href, { 'classic-editor': '', 'classic-editor__forget': '' } ); + var linkText = lodash.get( window, [ 'classicEditorPluginL10n', 'linkText' ] ) || 'Switch to Classic Editor'; + + return createElement( + PluginMoreMenuItem, + { + icon: 'editor-kitchensink', + href: url, + }, + linkText + ); + }, + } ); +} )( window.wp ); |