- htttp://www.flippercode.com
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
add_filter('wpgmp_render_shortcode','wpgmp_render_shortcode',1,2 ); | |
function wpgmp_render_shortcode($bool,$map) { | |
//Default is TRUE. | |
$bool = FALSE; | |
return $bool; | |
} |
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
add_filter('wpgmp_marker_source','wpgmp_marker_source',1,2); | |
function wpgmp_marker_source($markers,$map_id) { | |
/* You can create array of the markers to add on the google maps dynamically. It's very useful hook if you want to fetch | |
locations from an external database, API, JSON or XML. | |
*/ | |
$markers = array(); |
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
add_filter('wpgmp_post_placeholder', 'wpgmp_post_placeholder',1,3 ); | |
function wpgmp_post_placeholder($placeholders,$post,$map) { | |
// Posts Details | |
$placeholders['post_excerpt'] = get_the_content($post->ID); | |
return $placeholders; | |
} |
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
add_filter('wpgmp_featured_image', 'wpgmp_featured_image',1,3 ); | |
function wpgmp_featured_image($image,$post_id,$map_id) { | |
// Modify img tag containing featured image. | |
$image = '<img src="http://lorempixel.com/400/200/" />'; | |
return $image; | |
} |
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
add_filter('wpgmp_featured_image_size', 'wpgmp_featured_image_size',1,3 ); | |
function wpgmp_featured_image_size($size,$post,$map) { | |
//$size = 'thumbnail'; | |
//$size = 'medium'; | |
$size = array(50,50); | |
return $size; |
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
add_filter('wpgmp_taxonomy_separator', 'wpgmp_taxonomy_separator',1,2 ); | |
function wpgmp_taxonomy_separator($separtor,$map) { | |
$separtor = "|"; //default separator is comma (,) | |
return $separtor; | |
} |
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
add_filter('wpgmp_post_args', 'wpgmp_post_args',1,2 ); | |
function wpgmp_post_args($args,$map) { | |
global $post; | |
if(is_category(1)) { | |
$args['category__in'] = 1; // Show Posts of Category ID = 1 on the google maps. | |
} | |
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
add_filter('wpgmp_maps_options', 'wpgmp_maps_options',1,2 ); | |
function wpgmp_maps_options($map_settings,$map) { | |
global $post; | |
if(is_front_page()) { | |
$map_settings['zoom'] = 15; | |
} else if(is_single()) { | |
$map_settings['zoom'] = 10; |
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
add_filter('wpgmp_listing_html', 'wpgmp_listing_html',1,2 ); | |
function wpgmp_listing_html($listing_html,$map) { | |
$listing_html = "<div class='listing_item'><h3>{marker_title}</h3> <p>{marker_message}</p></div>"; | |
return $listing_html; | |
} |
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
add_filter('wpgmp_infowindow_post_message', 'wpgmp_infowindow_post_message',1,2 ); | |
function wpgmp_infowindow_post_message($message,$map) { | |
global $post; | |
//This will apply for map id 1. | |
if( $post->ID == 1) { | |
$message = "<h1>{marker_title}</h1>"; | |
} | |
if( $post->ID == 107) { |