For websites which use only one map, is there a way to set it to show all locations you create on the map?

By default it seems you have to add a location, and then after that, edit the map and select the checkbox next to the location you just created under add location to show it.

Wondering if there is a way to eliminate that second step when a site plans to only use one map, so you can just add a location and it shows up on the map right away.

Yeah this is absolutely possible via using Hooks. You need to insert the hook code in your activated theme functions.php.
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;
return $location_criteria;

I hope it helps you.
Excellent - thank you!

Please login or Register to Submit Answer