Skip to content

Instantly share code, notes, and snippets.

@craigsimps
Last active May 10, 2018 21:48
Show Gist options
  • Select an option

  • Save craigsimps/d281811caf61543444d7a87a3fd77269 to your computer and use it in GitHub Desktop.

Select an option

Save craigsimps/d281811caf61543444d7a87a3fd77269 to your computer and use it in GitHub Desktop.
<?php
define( 'GOOGLE_MAPS_API_KEY', 'your_key_here' );
add_action( 'acf/init', __NAMESPACE__ . '\set_google_maps_api_key' );
/**
* Set Google Maps API key for use in ACF Pro backend.
*
* @since 1.0.0
*/
function set_google_maps_api_key() {
acf_update_setting( 'google_api_key', GOOGLE_MAPS_API_KEY );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment