Home › Forums › ACF PRO › ACF Google Maps callback error › Reply To: ACF Google Maps callback error
I came across the same issue just now. Turns out that in wp-content\plugins\advanced-custom-fields-pro\includes\fields\class-acf-field-google-map.php the callback
param is set to an empty string:
// vars
$api = array(
'key' => acf_get_setting( 'google_api_key' ),
'client' => acf_get_setting( 'google_api_client' ),
'libraries' => 'places',
'ver' => 3,
'callback' => '',
'language' => acf_get_locale(),
);
Just below this there’s a filter we can use to override these params:
// filter
$api = apply_filters( 'acf/fields/google_map/api', $api );
I found a post on Stack Overflow that suggests setting the callback
param to Function.prototype
, see https://stackoverflow.com/a/75212692
This fix works for me:
add_filter('acf/fields/google_map/api', function ($api) {
$api['callback'] = 'Function.prototype';
return $api;
});
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!
CPT registration is coming to ACF! We demoed the new feature during the most recent session of ACF Chat Fridays. Check out the summary for the details. https://t.co/k2KQ3WWBAz
— Advanced Custom Fields (@wp_acf) March 7, 2023
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.