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","add_markers",1,2); | |
function add_markers($markers,$map_id) | |
{ | |
global $post; | |
$new_markers = array(); | |
$the_query_map = new WP_Query( array( 'meta_key' => 'location' , 'category_name' => 'unites-states' ) ); | |
if($the_query_map->have_posts()) : | |
while($the_query_map->have_posts()): $the_query_map->the_post(); | |
$get_google_map = get_post_meta(get_the_id(),'location','true'); |
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","add_markers",1,2); | |
function add_markers($markers,$map_id) | |
{ | |
global $post; | |
$new_markers = array(); | |
$the_query_map = new WP_Query( array( 'meta_key' => 'location' ) ); | |
if($the_query_map->have_posts()) : | |
while($the_query_map->have_posts()): $the_query_map->the_post(); | |
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($default,$map_id) { | |
global $post; | |
$acf_location = get_post_meta($post->ID,'location'); | |
if(is_array($acf_location)) { | |
$default['center_lat']= $acf_location[0]['lat']; | |
$default['center_lng']= $acf_location[0]['lng']; |
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($default,$map_id) { | |
// Declare global $post to get current post data. | |
global $post; | |
// Get current post's latitude added by wp google map pro meta box. | |
$default[center_lat]= get_post_meta($post->ID,'_wpgmp_metabox_latitude'); | |
// Get current post's longitude added by wp google map pro meta box. | |
$default[center_lng]=get_post_meta($post->ID,'_wpgmp_metabox_longitude'); | |
//Return modified center location of the map. | |
return $default; |