Since: 3.1.4
File: includes/wp-geo.php
Param: $title Point title (defaults to post title)
Param: $post_id Post ID
By default the tooltip for markers will display the post title. The wpgeo_point_title filter lets you override this value so you can set different text for the tooltip.
The filter accepts two arguments. The first is the default marker title which you can override or add to. The second argument is the ID of the post – you could use to get some post meta data to display as the title.
Example 1
function my_wpgeo_point_title( $title, $post_id ) { // Add a prefix to the point title return 'My Point: ' . $title; } add_filter( 'wpgeo_point_title', 'my_wpgeo_point_title' );
Example 2
function my_wpgeo_point_title( $title, $post_id ) { // Add a coordinates to the point title $latitude = get_post_meta($post_id, WPGEO_LATITUDE_META, true); $longitude = get_post_meta($post_id, WPGEO_LONGITUDE_META, true); return $title . ' (' . $latitude . ', ' . $longitude . ')'; } add_filter( 'wpgeo_point_title', 'my_wpgeo_point_title' );