Skip to content

Instantly share code, notes, and snippets.

@wpflippercode
Created September 12, 2017 05:52
Show Gist options
  • Save wpflippercode/57c72a7e5adc2c7f0ee113756fcf360a to your computer and use it in GitHub Desktop.
Save wpflippercode/57c72a7e5adc2c7f0ee113756fcf360a to your computer and use it in GitHub Desktop.
Show Markers on Google Maps According to Post ID in the WordPress
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 {
$places = array_slice($places, 20,10);
}
return $places;
}
@shyamkariya825
Copy link

I have used this hook and override the location icon.
It is working fine when on page load but when i filter location from tab filter (unchecked category and check again) at that time icon replace with there category icon.
I want that icon which is set by hook.
Is there any other hook for tab filter or any solution for this?

@wpflippercode
Copy link
Author

Hello,

Please create a support ticket at https://weplugins.com/support and our support team will help you.

Best Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment