Google Maps API multiple times

This topic contains 2 reply and 2 voices, and was last updated by jlc 10 years, 8 months ago
Viewing 2 Posts - 1 through 2 (of 2 total)
Author Posts
July 25, 2013 at 1:18 pm 6303
jlc Hi, Activating the plugin i have this warning in Firebug: you have included the Google Maps API multiple times on this page. I'm using maps on my nav menu to show where the posts are located. So is there any way to not load the google maps api of the plugin? I unchecked the option to not load scripts and css in all pages in your plugin settings, but the error persist. Thank you!
July 26, 2013 at 3:04 am 6324
Tareq Hasan Tareq Hasan

As there are different plugin is loading google maps, so yes there’ll be error messages like this. WordPress prevents script duplication by checking the handle, but different plugin will have different handles for sure.

So the solution would be removing google maps from either any of the plugins. In my plugin, you can remove the line

wp_enqueue_script( 'google-maps', $scheme . '://maps.google.com/maps/api/js?sensor=true' );

from wpuf.php.

July 27, 2013 at 2:43 pm 6379
jlc jlc

Thank you!

Viewing 2 Posts - 1 through 2 (of 2 total)