Created
July 27, 2015 18:59
-
-
Save luistinygod/64c6c670281f56315f94 to your computer and use it in GitHub Desktop.
GravityView Maps Premium View: Filter the address field content before using it to geocode
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 | |
/** | |
* Filter the address field content before geocoding | |
* @param string $address Address value | |
* @param array $entry Gravity Forms entry object | |
*/ | |
function my_gv_maps_address_value( $address, $entry ) { | |
if ( 'MY_FORM_ID' != $entry['form_id'] ) { | |
return $address; | |
} | |
// do something to $address | |
return $address; | |
} | |
add_filter( 'gravityview/maps/marker/address', 'my_gv_maps_address_value', 10, 2 ); | |
// Note: Replace the MY_FORM_ID by the Form ID where you'll want to apply this code. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment