Hi @rose18,
Thank you for getting in touch, we do appreciate your time.
As all of the mentioned dependencies are non-essential (not core) modules, you only need to dequeue these using the ‘wpgooglemaps_hook_user_js_after_core’ hook, I’ve prepared a specific code block for you:
function wpgmza_dequeue_additional_dependencies(){
wp_dequeue_style('featherlight');
wp_dequeue_script('featherlight');
wp_dequeue_style('wpgmaps_datatables_responsive-style');
wp_dequeue_script('wpgmza_canvas_layer_options');
wp_dequeue_script('wpgmza_canvas_layer');
wp_dequeue_script('polyline');
}
add_action('wpgooglemaps_hook_user_js_after_core', 'wpgmza_dequeue_additional_dependencies', 9999);
This has been tested on my side and works as expected. If it is not working on your side, I’d need to know a bit more about how you’re adding this PHP to your site?
We recommend adding it to the functions.php file of your child theme, to ensure it loads correctly to dequeue these assets.
Thread Starter
rose18
(@rose18)
@dylanauty thank you! but adding your code block still doesn’t work for me, the frontend is still loading those files.
I added the code to my functions.php file in my child theme.
Thread Starter
rose18
(@rose18)
@dylanauty – Also to add, I have WP Go Maps Pro plugin installed, does that affect the code that you’ve provided? thanks!
Hi @rose18,
Thank you for getting back to me, I do appreciate it.
That is quite strange as this same code has been used on many sites (including our own development sites) and works without issue. I suspect there may be some additional layer of functionality preventing our code from taking affect.
Unfortunately we aren’t allowed to discuss any Premium features/questions via these threads, as per the WordPress.org guidelines.
Would you mind opening a support ticket on our website instead so that someone from my team can work more closely with you on this to get it sorted?