Since: 3.2
File: includes/wp-geo.php
File: includes/templates.php
File: includes/widgets.php
Param: $marker_id String Marker ID
Param: $post Int Post Object
Param: $context String Marker context

This filter allows you to override a marker icon to display a different marker icon.

It passes three parameters so you can change the marker depending on the current post and the context. Possible values for context are:

  • widget
  • wpgeo_map
  • post
  • multiple

Example

This example shows how to replace all instances of the large marker icon with small marker icons.

function my_wpgeo_marker_icon( $marker_id, $post, $context ) {
	if ( $marker_id == 'wpgeo_icon_large' ) {
		$marker_id = 'wpgeo_icon_small';
	}
	return $marker_id;
}
add_filter( 'wpgeo_marker_icon', 'my_wpgeo_marker_icon', 10, 3 );

One Response to “wpgeo_marker_icon”

  1. marty says:

    Is it possible to show a little thumbnail of the featured post image instead of a marker?

Leave a Reply