- htttp://www.flippercode.com
This file contains 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_location_criteria','wpgmp_location_criteria',1,2 ); | |
function wpgmp_location_criteria($criteria,$map) { | |
$criteria['show_all_locations'] = true; | |
return $criteria; | |
} |
This file contains 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('agp_current_settings', 'agp_current_settings',1,1); | |
function agp_current_settings($options) { | |
if(is_category('beer')) { | |
$options['min_age'] = 16; | |
} elseif(is_category('spirits')) { | |
$options['min_age'] = 18; | |
} |
This file contains 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
<?php | |
$CURRENTPOST_LAT = get_post_meta(get_the_ID(),'_wpgmp_metabox_latitude',true); | |
$CURRENTPOST_LON = get_post_meta(get_the_ID(),'_wpgmp_metabox_longitude',true); | |
echo do_shortcode("[display_map marker1='$CURRENTPOST_LAT | $CURRENTPOST_LON | hello world | Bla Bla | category']"); | |
?> |
This file contains 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_location_criteria', 'wpgmp_location_criteria',1,2 ); | |
function wpgmp_location_criteria($location_criteria,$map) { | |
//This will apply for map id 1. | |
if( $map->map_id == 1) { | |
$location_criteria['show_all_locations'] = true; | |
$location_criteria['category__in'] = array(1,2,3); // You can use category name as well. | |
} | |
return $location_criteria; |
This file contains 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_location_criteria', 'wpgmp_location_criteria',1,2 ); | |
function wpgmp_location_criteria($location_criteria,$map) { | |
//This will apply for map id 1. | |
if( $map->map_id == 1) { | |
$location_criteria['show_all_locations'] = true; | |
} | |
return $location_criteria; |
This file contains 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_location_criteria', 'wpgmp_location_criteria',1,2 ); | |
function wpgmp_location_criteria($location_criteria,$map) { | |
//This will apply for map id 1. | |
if( $map->map_id == 1) { | |
$location_criteria['show_all_locations'] = true; | |
$location_criteria['category__not_in'] = array(1,2); // You can use category name as well. | |
} | |
return $location_criteria; |
This file contains 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_message', 'wpgmp_infowindow_message',1,2 ); | |
function wpgmp_infowindow_message($message,$map) { | |
global $post; | |
if( $post->ID == 1) { | |
$message = "<h1>{marker_title}</h1>"; | |
} | |
if( $post->ID == 2) { |
This file contains 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 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 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. | |
} | |