Home › Forums › Front-end Issues › Display Map in Topic Post › Reply To: Display Map in Topic Post
This worked for me:
https://www.advancedcustomfields.com/resources/google-map/#requirements
Note: this code crashed my site
function my_acf_google_map_api( $api ){
$api['key'] = 'xxx';
return $api;
}
add_filter('acf/fields/google_map/api', 'my_acf_google_map_api');
This code did work:
function my_acf_init() {
acf_update_setting(‘google_api_key’, ‘xxx’);
}
add_action(‘acf/init’, ‘my_acf_init’);
NOTE: When I went to edit the topic that was working all of my custom fields were missing.
They were also gone in the ACF plugin module. (This happened to me before.)
So I created new custom fields and everything seems to be working fine. All I can think is the function code that crashed corrupted the ACF.
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.