Skip to content

Instantly share code, notes, and snippets.

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 purivus-dev/9bd68355e73685a0d3ddf22b69048fe5 to your computer and use it in GitHub Desktop.
Save purivus-dev/9bd68355e73685a0d3ddf22b69048fe5 to your computer and use it in GitHub Desktop.
Modify Info Window Contents for Posts Using Hook
add_filter('wpgmp_infowindow_post_message', 'wpgmp_infowindow_post_message',1,2 );
function wpgmp_infowindow_post_message($message,$map) {
//This will apply for map id 1, by accessing the map-object.
if( $map->map_id == '1') {
$message = "<h1>{marker_title}</h1>";
}
return $message;
}
@purivus-dev
Copy link
Author

Changed post-object (representing current page or post) to map-object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment