I am trying to have all my maps (home, listing and details page maps) to show my 1 default company icon.
Why i just wont repeat the icon on category icon is that i need every category to have separate icon to display on details page later.
I used both codes from this topic: https://wpgeodirectory.com/support/topic/map-icon/
It worked perfectly with sub-categorys, but could it be tweaked to show defult icon (set at design>map>Upload map default marker icon) on all the maps all the time.
The codes i used:
(it pulls from higher cat id, but i dont want sub categorys, it just makes useless string for front and back end usage)
add_filter('geodir_before_marker_post_process','_my_use_higher_cat_id');
function _my_use_higher_cat_id($posts){
if(!empty($posts)){
foreach($posts as $key=>$post){
$pt = esc_attr($_REQUEST['gd_posttype']);
if(isset($post->{$pt.'category'})){
$cats = array_filter(explode(',',$post->{$pt.'category'}));
$post->default_category = max($cats);
$posts[$key] = $post;
}
}
}
return $posts;
}
add_filter('geodir_map_canvas_jason_detail_page_map_canvas','_my_edit_detail_marker',10,1);
function _my_edit_detail_marker($map_canvas_jason_args){
echo '###';
print_r($map_canvas_jason_args);
return $map_canvas_jason_args;
}