banner



How Can I Register My Google Api Key In My Functions.php File In Wordpress

Register & define a Google Maps API key to allow the location field to work correctly.

First annals a API primal 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 fundamental, the other hooks into the Google Map ACF field and gear up the key on the fly.

<?php
// Define this in the site's wp-config.php file.
define('GOOGLE_API_KEY', 'your-google-api-primal-here');
// Add this to your functions.php file, or a config plugin/MU plugin.
add_action( 'acf/init', role () {
acf_update_setting( 'google_api_key', GOOGLE_API_KEY );
} );

Continue upward to appointment with all things ACF!

Subscribe to our newsletter or follow @awesomeacf on Twitter!

Source: https://www.awesomeacf.com/snippets/register-google-maps-api-key/

Posted by: hernandezagantiched.blogspot.com

0 Response to "How Can I Register My Google Api Key In My Functions.php File In Wordpress"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel