Created
February 23, 2016 02:11
-
-
Save jasonday/9cbaeed674fb22e2d54d to your computer and use it in GitHub Desktop.
Pronamic google maps - post image as pin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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