Created
September 2, 2015 12:32
-
-
Save luistinygod/1beebb5ac356b1a16653 to your computer and use it in GitHub Desktop.
GravityView Maps Premium View: Specify the Latitude and Longitude form field IDs (to be used instead of the address field)
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
<?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
correcting the single quotes:
add_filter( 'gravityview/maps/markers/lat_long/fields_id', 'my_gv_maps_lat_long_fields', 10, 2 );