Modifying the "Map It" address link

Available in GravityView 1.1.7 and higher.

To modify the "Map It" link generated by GravityView, use the gravityview_map_link filter.

The filter is located inside the gravityview_get_map_link() function.

The filter passes three arguments:

  • $link - Existing anchor tag
  • $address - Address to generate link for
  • $url - The URL that was generated by GravityView. By default, a Google Maps link

Here's a simple code snippet to change the 'Map It' text to 'View on Google Maps':

add_filter( 'gravityview_map_link', 'gv_change_map_it', 10, 5 );
function gv_change_map_it( $link, $address, $url  ){
	$link = str_replace('Map It','View on Google Maps',$link);
	return $link;
}

Read here how to add these code samples to your website: Where to put code samples.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us