Conflict generated by CoBlocks when I use GreenShift
-
Hello,
I’m encountering many problems due to a conflict generated by CoBlocks when I use GreenShift.
When I activate CoBlocks, the blocks show the error: ‘This block contains unexpected or invalid content.’ Additionally, the inspector indicates a block validation error in
blocks.min.js
: ‘Block validation failed forcore/paragraph
.’The GS team indicates to me this:
“I can tell you that Coblocks are intrusive in all other blocks. they save own animation attributes to our block (they should not do this). You can ask author of Coblocks how to restrict intrusion to other blocks so all their attributes are saved only in Coblocks and do not affect other blocks, at least Greenshift blocks. our blocks have “greenshift-blocks/” prefix. So, they can check name before saving their custom attributes in our blocks”
Can you correct this and before and before telling me the code to use to block your attribute injections in Gutenberg only?
The idea would be to remove the injection of all CSS and JS handles through code in functions.php// Disable CoBlocks scripts and styles in the Gutenberg editor
function disable_coblocks_assets_in_editor() {
// Check if we are in the Gutenberg editor
if (is_admin() && (defined('DOING_AJAX') && DOING_AJAX || isset($_GET['post_type']) && $_GET['post_type'] === 'page')) {
// List of handles to disable
$handles_to_remove = [
'coblocks-editor', // Style
'coblocks-frontend', // Style
'coblocks-extensions', // Style
'coblocks-animation', // Style
'coblocks-1', // Script
'coblocks-2', // Script
'coblocks-3', // Script
'coblocks-4', // Script
'coblocks-5', // Script
'coblocks-6', // Script
'coblocks-7', // Script
'coblocks-8', // Script
'coblocks-9', // Script
'coblocks-10', // Script
'coblocks-11', // Script
'coblocks-12', // Script
'coblocks-13', // Script
'coblocks-tiny-swiper', // Script
'coblocks-tinyswiper-initializer', // Script
];
// Disable each style and script in the list
foreach ($handles_to_remove as $handle) {
wp_dequeue_style($handle); // Dequeue the style
wp_dequeue_script($handle); // Dequeue the script
}
}
}
add_action('enqueue_block_editor_assets', 'disable_coblocks_assets_in_editor', 100)Thank you very much in advance for your help.
- You must be logged in to reply to this topic.