Skip to content

Instantly share code, notes, and snippets.

@luistinygod
Created July 27, 2015 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luistinygod/64c6c670281f56315f94 to your computer and use it in GitHub Desktop.
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
<?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