fbpx
Awesome

Register Google Maps API Key for ACF

First register a API key for Google Maps then include the following snippet to register the key with ACF. This snippet has two parts — one part defines a constant containing the key, the other hooks into the Google Map ACF field and set the key on the fly.

<?php
// Define this in the site's wp-config.php file.
define('GOOGLE_API_KEY', 'your-google-api-key-here');
// Add this to your functions.php file, or a config plugin/MU plugin.
add_filter( 'acf/fields/google_map/api', function ( $api ) {
$api['key'] = GOOGLE_API_KEY;
return $api;
} );

This is a Hookturn plugin ad block

This is a Hookturn plugin ad block

Built by Hookturn

This site was created by Hookturn, the team behind ACF Theme Code Pro. If you are interested in contributing or have an extension to add, email us.

Sponsored by Pressidium

Awesome ACF is sponsored by the very awesome team at Pressidium. If you need reliable, secure and scalable Managed WordPress Hosting, check them out.

Stay up to date with all things ACF

TODO: Registration form here