• I have a problem with the new widgets editor / with the deactivation of individual blocks in my base theme. After the update to 5.8 I got the message: "wp-editor" script should not be enqueued together with the new widgets editor (wp-edit-widgets or wp-customize-widgets).

    I also found the responsible part in my theme – I have a js-file in which I make various adjustments to the editor and blocks (actually I use wp.blocks.unregisterBlockType, wp.blocks.unregisterBlockVariation, wp.blocks.registerBlockType, wp.blocks.registerBlockStyle and wp.hooks.addFilter). The script is loaded via wp_enqueue_script( 'theme-blocks', get_template_directory_uri() .'/assets/js/blocks.js', array( 'wp-element', 'wp-blocks', 'wp-dom-ready', 'wp-edit-post' ) ); whereby the wp-edit-post part is responsible for the error message.

    However, when I remove this, wp.blocks.unregisterBlockType and wp.blocks.unregisterBlockVariation no longer work (yes, they are in a wp.domReady call as they should).. In the new theme.json there is also no possibility to specify a list of deactivated blocks.

    Funnily enough, the console still says: Block "xxx/xxx" is not registered, although I can add it again from the inserter after removing wp-edit-post as dependency.

    So, how do I deactivate specific blocks for my theme without using wp-edit-post?

    • This topic was modified 3 years, 2 months ago by Azragh.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @azragh

    It possibly sounds like a bug that can be reported here – https://github.com/WordPress/gutenberg/issues.

    Have you had any success yet?

    Thread Starter Azragh

    (@azragh)

    No success, only more problems. The last update broke my mobile previews completely cause they are in an iframe now. My editor styles seem now to be “included wrong” as im using add_block_editor_assets(). When I change this, I have to refactor the whole gutenberg css and merge it together with my tinymce styles. My custom property for editor with isn’t recognized on mobile previews anymore and gets lost when you switch back to desktop cause dom changes now. My changes to remove scrollbars on previews broke too cause i can now only address the HTML which holds the iframe and so on.. there are plenty more issues.

    Honestly, im tired af. I posted so many issues there, invested hundrets of hours in updating my stuff the last years and still I have nothing nearly stable to offer to clients.

    Hopefully, someone else in the form could provide more support.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘“wp.blocks.unregisterBlockType” doesn’t work without “wp-edit-post” in 5.8’ is closed to new replies.