diff --git a/src/resources/js/lib/configure-editor.js b/src/resources/js/lib/configure-editor.js index 95eb8c00..05dd4c91 100644 --- a/src/resources/js/lib/configure-editor.js +++ b/src/resources/js/lib/configure-editor.js @@ -12,6 +12,7 @@ export default function configureEditor (options) { setupMedia(options) setupSidebar(options) setupSubmit(editorSettings.target) + disableWPBlocks() removeBlockManagement() if (options.maxHeight) { setMaxHeight(options.maxHeight) } if (options.minHeight) { setMinHeight(options.minHeight) } @@ -28,6 +29,20 @@ export function clearSubmitFromButtons () { } } +function disableWPBlocks () { + data.dispatch('core/blocks').removeBlockTypes([ + 'core/archives', + 'core/categories', + 'core/freeform', + 'core/latest-comments', + 'core/latest-posts', + 'core/more', + 'core/nextpage', + 'core/page-break', + 'core/shortcode' + ]) +} + /** * Sets the max-height style value * @param {String} maxHeight css value for max-height @@ -68,9 +83,11 @@ function setupMedia (options) { if (options.laravelFilemanager) { setupLaravelFilemanager(options.laravelFilemanager) } else { - data.dispatch('core/blocks').removeBlockTypes('core/cover') - data.dispatch('core/blocks').removeBlockTypes('core/gallery') - data.dispatch('core/blocks').removeBlockTypes('core/media-text') + data.dispatch('core/blocks').removeBlockTypes([ + 'core/cover', + 'core/gallery', + 'core/media-text' + ]) } }