Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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