Created
July 27, 2015 18:44
-
-
Save luistinygod/f7de6db9089a3298358d to your computer and use it in GitHub Desktop.
GravityView Maps Premium View: Customise the address field ID
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 | |
/** | |
* 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