- 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_map_output','wpgmp_map_output',1,3 ); | |
function wpgmp_map_output($output,$map_div,$listing_div,$map_id) { | |
// You can use $map_div and $listing_div to place them according to your need. | |
$output = "<div style='float:right'>".$map_div."</div>"; | |
$output .= "<div style='float:left'>".$listing_div."</div>"; | |
return $output; | |
} |
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_after_map','wpgmp_after_map',1,2 ); | |
function wpgmp_after_map($custom_html,$map) { | |
$custom_html = "<p class='map-description'>Insert custom html after google maps.</p>"; | |
return $custom_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_map_container_class','wpgmp_map_container_class',1,2); | |
function wpgmp_map_container_class($class,$map) { | |
$class="custom_map_css"; | |
return $class; | |
} |
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_before_map','wpgmp_before_map',1,2 ); | |
function wpgmp_before_map($section,$map) { | |
$section = "<p class='map-description'>Use below map to visit our offices and search nearby office.</p>"; | |
return $section; | |
} |
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','wpgmp_listing',1,2 ); | |
function wpgmp_listing($listing,$map) { | |
$listing['listing_placeholder'] = "<div class='listing-item'><h4>{marker_title}</h4><p>{marker_address}</p></div>"; | |
return $listing; | |
} |
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
// Sort by custom field. e.g "salary". | |
add_filter('wpgmp_sorting','wpgmp_sorting_custom_field',1,2); | |
function wpgmp_sorting_custom_field($sorting,$map) { | |
$sorting['%salary%__asc__num'] ="Salary Low-High"; | |
$sorting['%salary%__desc__num'] ="Salary High-Low"; | |
return $sorting; | |
} |
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
// Sort by extra field. e.g "phone". | |
add_filter('wpgmp_sorting','wpgmp_sorting_extra_field',3,2); | |
function wpgmp_sorting_extra_field($sorting,$map) { | |
$sorting['phone__asc__num'] ="Phone A-Z"; | |
$sorting['phone__desc__num'] ="Phone Z-A"; | |
return $sorting; | |
} |
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
// Sort by city. | |
add_filter('wpgmp_sorting','wpgmp_sorting_location_field',2,2); | |
function wpgmp_sorting_location_field($sorting,$map) { | |
$sorting['city__asc'] ="City A-Z"; | |
$sorting['city__desc'] ="City Z-A"; | |
return $sorting; | |
} |
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_markers','wpgmp_markers',1,3 ); | |
function wpgmp_markers($places,$map) { | |
global $post; | |
if( $post->ID == 1 ) { | |
$places = array_slice($places, 1,10); | |
} else if ($post->ID == 2) { | |
$places = array_slice($places, 10,10); | |
} else { |
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_show_place','wpgmp_show_place',1,3 ); | |
function wpgmp_show_place($show,$place,$map) { | |
// Here hide the marker with ID = 12665. | |
if($place['id'] == 12665) { | |
$show = FALSE; | |
} | |
return $show; | |
} |