Created
August 11, 2017 16:13
-
-
Save rafaehlers/95b2fc194473a7c9b343420af00626f3 to your computer and use it in GitHub Desktop.
Use the cordinates (Latitude and Longitude) instead of the address to position the markers over the Maps
This file contains hidden or 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
<?php | |
/** | |
* Use the cordinates (Latitude and Longitude) instead of the address to position the markers over the Maps | |
* Replace 'MY_LATITUDE_FIELD_ID' and 'MY_LONGITUDE_FIELD_ID' by the form field ids containing the latitude and longitude | |
* @param array $fields Gravity Forms fields IDs containing the latitude and longitude | |
* @param GravityView_View object $view Current View object | |
*/ | |
function my_gv_maps_lat_long_fields( $fields, $view ) { | |
return array( 'MY_LATITUDE_FIELD_ID', 'MY_LONGITUDE_FIELD_ID' ); | |
} | |
add_filter( 'gravityview/maps/markers/lat_long/fields_id', 'my_gv_maps_lat_long_fields', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment