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!
ACF gives Rareloop greater control over the WordPress admin experience. See how in our case study. https://t.co/IFafQupmrl
— Advanced Custom Fields (@wp_acf) May 15, 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.