Skip to content

Instantly share code, notes, and snippets.

@wpflippercode
Created September 8, 2017 05:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpflippercode/4bb2cd13c6a26a08ec2a642a3c96b872 to your computer and use it in GitHub Desktop.
Save wpflippercode/4bb2cd13c6a26a08ec2a642a3c96b872 to your computer and use it in GitHub Desktop.
Show Locations on the maps by exlcuding certain categories.
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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment