Created
February 1, 2017 21:36
-
-
Save coderaaron/f371092021f684620b9a0527eadd011b to your computer and use it in GitHub Desktop.
Set the default map center
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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