Home Forums Plugin Support WP User Frontend Pro Google Maps API multiple times

This topic is: resolved

This topic contains 2 replies, has 2 voices, and was last updated by  jlc 5 years, 6 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #6303

    jlc
    Participant
    Post count: 5

    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!

    #6324

    Tareq Hasan
    Keymaster
    Post count: 2831

    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.

    #6379

    jlc
    Participant
    Post count: 5

    Thank you!

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Google Maps API multiple times’ is closed to new replies.