Skip to content

Instantly share code, notes, and snippets.

@coderaaron
Created February 1, 2017 21:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coderaaron/f371092021f684620b9a0527eadd011b to your computer and use it in GitHub Desktop.
Save coderaaron/f371092021f684620b9a0527eadd011b to your computer and use it in GitHub Desktop.
Set the default map center
add_filter( 'acf/load_field/name=washu_ppi_map', array( self::$instance, 'set_default_google_maps_center' ) );
...
public static function set_default_google_maps_center( $field ) {
$google_map_center = get_field( 'washu_ppi_places_map_center', 'option' );
$field[ 'center_lat' ] = $google_map_center[ 'lat' ];
$field[ 'center_lng' ] = $google_map_center[ 'lng' ];
return $field;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment