Home › Forums › Backend Issues (wp-admin) › Google Maps field needs setting to add API key › Reply To: Google Maps field needs setting to add API key
As I was looking through the source code I found this filter in the get_setting()
function
[…]
// filter for 3rd party customization
if( substr($name, 0, 1) !== '_' ) {
$value = apply_filters( "acf/settings/{$name}", $value );
}
[…]
So you could simply add a filter like this:
add_filter('acf/settings/google_api_key', function ($value) {
return 'YOUR_API_KEY';
});
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.