Since: 3.2
File: includes/markers.php
Param: $markers Array of WPGeo_Marker objects

This filter is allows you to create and add a new marker icon.

Example

This example create a new marker icon that can be referenced as ‘my_large’.

function my_wpgeo_markers( $markers ) {
	$markers[] = new WPGeo_Marker(
		'my_large',
		'My Large Marker',
		'This is my large marker image.',
		44, 48, 10, 34, // width, height, anchorx, anchor y
		'http://wordpress-30.local/wp-content/plugins/wp-geo-pplogo-marker/pp_logo.png',
		'http://wordpress-30.local/wp-content/plugins/wp-geo-pplogo-marker/pp_logo.png'
	);
	return $markers;
}
add_action( 'wpgeo_markers', 'my_wpgeo_markers' );

4 Responses to “wpgeo_markers”

  1. 2chihazo says:

    thank you for added me in wpgeo_markers.

  2. Gaijin San says:

    I have succeeded adding a custom marker inserting this code in
    /wp-content/plugins/wp-geo/includes/functions.php
    The new marker appears in the drop-down menu in the post editor.

    I am new to php and cannot think now of how to add 2 custom markers.

    Could you give an example adding 2 custom markers / icons / pins ? It would be easy then to replicate the same logic (even for php illiterate people) to add 2, 3, or many more markers?

    Thanks!

Leave a Reply