Bug: Conflict with Other Plugins in Block Editor
-
Issue:
For Hustle Gutenberg blocks, ‘Social Share’ and ‘Embeds’ in the ‘wp_enqueue_script’ method, ‘hui_scripts’ is not added as script dependency. This may cause issues in the Gutenberg editor (based on how WordPress enqueue scripts) and may break other plugins. Please see the attached screenshots for how these scripts are enqueued.
https://paste.pics/BKXY2
https://paste.pics/BKXYDSuggestion:
Please add the dependency of ‘hui_scripts’ in ‘wp_enqueue_script’ for the handles ‘hustle-block-embeds’ and ‘hustle-block-social-share’.
wp_enqueue_script( 'hustle-block-embeds', Hustle_Gutenberg::get_plugin_url() . '/js/embeds-block.min.js', array( 'wp-blocks', 'wp-i18n', 'wp-element', 'hui_scripts' ), filemtime( Hustle_Gutenberg::get_plugin_dir() . '/js/embeds-block.min.js' ) ); wp_enqueue_script( 'hustle-block-social-share', Hustle_Gutenberg::get_plugin_url() . '/js/social-share-block.min.js', array( 'wp-blocks', 'wp-i18n', 'wp-element', 'hui_scripts' ), filemtime( Hustle_Gutenberg::get_plugin_dir() . '/js/social-share-block.min.js' ) );
Please refer to the screenshot below for how the scripts are now properly enqueued.
Note: Sorry! I can’t give more details about the plugins used and other site related details as I have fixed this issue for a client.
- The topic ‘Bug: Conflict with Other Plugins in Block Editor’ is closed to new replies.