I’m using Enfold and the plugin VO Store Locator.
Both uses the Google Maps API with the same key.
When I try to edit the stetting in the plugin, there are disfunctions and I’m getting this error in the console:
You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors.
Is it possible to deactivate the Enfold Google Maps API on the plugin-page or something like that?
The page would be “vo-locator-the-wp-store-locator” from the admin url.
in addition:
when i disable Google MAPS API through the child theme with
add_filter('avf_load_google_map_api_prohibited', 'avf_load_google_map_api_prohibited_true', 10, 1);
function avf_load_google_map_api_prohibited_true($prohibited) {
$prohibited = true;
return $prohibited;
}
everything works fine inside the plugin.
Hi mahiho,
We’re glad to hear that. :)
And thanks for posting the solution that worked for you, it should help anyone with similar issues.
Best regards,
Nikko
Hi Nikko,
the addition was only the way to find out what is the problem and to configure the plugin.
Is it possilbe to deactivate the maps api for the plugin pages?
Hi mahiho,
I’m not really sure how to target plugin pages but I think these might be helpful:
– https://codex.wordpress.org/Function_Reference/get_current_screen
– https://developer.wordpress.org/reference/functions/get_plugin_page_hookname/
Another thread which might give you additional idea: https://kriesi.at/support/topic/disable-google-maps-api-call-in-backend/
Best regards,
Nikko