coblocks icon indicating copy to clipboard operation
coblocks copied to clipboard

`wp-edit-post` dependency loaded in the customizer

Open sergiu-radu opened this issue 1 year ago • 0 comments

Hello,

One of the Blocksy theme developers here.

I’m reaching out about an issue that happens with Blocksy theme, WooCommere and CoBlocks plugins being active on the site.

The problem can be observed in the block widgets editor in the Appearance -> Customize area only. Appearance -> Widgets screen works well.

In short, the issue is caused by CoBlocks loading the wp-edit-post dependency in the customizer screen. I saw that in the includes/class-coblocks-block-assets.php file there is a specific check that skips this dependency in the widgets.php screen but I believe this check should also cover the customizer area too, to avoid the mentioned problem.

We also have a work-around script for it that we gave the customer until a proper fix lands in CoBlocks, here it is:

add_action('enqueue_block_editor_assets', function () {
    global $wp_customize;

    if (! $wp_customize) {
        return;
    }

    wp_deregister_script('coblocks-editor');
}, 50);

I hope you could collaborate with us here on a solution. Thank you!

sergiu-radu avatar Feb 04 '25 07:02 sergiu-radu