It would appear that if you are using ACF, you can’t use any other Google Maps related plugin.
Adding another plugin that uses Google Maps causes the Google Maps JS code to be loaded twice, which causes both plugins to fail. If I disable ACF, the other plugins work. If I disable the other plugin, ACF works. I’ve tried this with ACF and 4 different Google Maps related plugins and it’s the same problem.
So, I don’t need ACF support for Google Maps, how do I disable Google Maps in ACF?
There is a setting for that https://www.advancedcustomfields.com/resources/acf-settings/
add_fitler('acf/settings/enqueue_google_maps', '__return_false');
Not working (even with the fixed typo).
Google Maps code still being loaded by ACF.
😛 I love those fitlers.
You’ve got me, it should be working. If a filter returns false then ACF returns from the function where it happens before the script can be enqueued.
I don’t know why, but since I’m using ACF Pro, this worked:
acf_update_setting('enqueue_google_maps', false );
I have Google Maps working now in my code.
I want to insert my Google Maps key to see if I can get that feature working.
I use a plugin “Events Manager” and its Google Map feature is still working even with ACF Pro installed. However he ACF Pro map is a dark grey static image with ‘development purposes’ watermarks.
What I don’t understand is probably very simple for someone in the know – when I see code modifications like the one above that start with
FUNCTIONS.PHP
Where is that file in my folders? Because a text search of my theme’s functions.php doesn’t find any code related to acf. I am browsing the plugins folder of ACF for a match but that seems sloppy if someone can direct me to the right place.
Thank you.
The topic ‘Google Maps’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.