Skip to content

Instantly share code, notes, and snippets.

@luistinygod
Created July 27, 2015 18:44
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/f7de6db9089a3298358d to your computer and use it in GitHub Desktop.
Save luistinygod/f7de6db9089a3298358d to your computer and use it in GitHub Desktop.
GravityView Maps Premium View: Customise the address field ID
<?php
/**
* Custom Maps address field ID
* @param mixed $field_id Gravity Forms field ID
* @param GravityView_View object $view Current View object
*/
function my_gv_maps_address_field( $field_id, $view ) {
if ( 'MY_VIEW_ID' != $view->view_id ) {
return $field_id;
}
return 'MY_NEW_FIELD_ID';
}
add_filter( 'gravityview/maps/markers/address/field_id', 'my_gv_maps_address_field', 10, 2 );
// Note: Replace the MY_VIEW_ID by the View ID where you'll want to apply this code and the MY_NEW_FIELD_ID by the form field ID containing the address string.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment