Skip to content

Instantly share code, notes, and snippets.

@jasonday
Created February 23, 2016 02:11
Show Gist options
  • Save jasonday/9cbaeed674fb22e2d54d to your computer and use it in GitHub Desktop.
Save jasonday/9cbaeed674fb22e2d54d to your computer and use it in GitHub Desktop.
Pronamic google maps - post image as pin
/**
* Filter snippet
*
* @see https://developers.google.com/maps/documentation/javascript/reference#MarkerOptions
*/
function prefix_pronamic_google_maps_marker_options( $marker_options ) {
// icon - Icon for the foreground
$thumb_id = get_post_thumbnail_id();
$thumb_url_array = wp_get_attachment_image_src($thumb_id, array(100,100), true);
$thumb_url = $thumb_url_array[0];
$marker_options['icon'] = $thumb_url;
// draggable - If true, the marker can be dragged. Default value is false.
$marker_options['draggable'] = true;
return $marker_options;
}
add_filter( 'pronamic_google_maps_marker_options', 'prefix_pronamic_google_maps_marker_options' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment