Skip to content

Instantly share code, notes, and snippets.

@JarrydLong
Last active August 9, 2023 14:13
Show Gist options
  • Save JarrydLong/173a3a862f896e1f2b949e783466970c to your computer and use it in GitHub Desktop.
Save JarrydLong/173a3a862f896e1f2b949e783466970c to your computer and use it in GitHub Desktop.
<?php
/**
* This recipe will override the default start location with a specific location.
* By default, we'll use the first marker on the map's location as the starting point
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function mypmromm_override_default_map_start( $coordinates, $map_id ){
$coordinates = array(
'lat' => -34.397,
'lng' => 150.644
);
return $coordinates;
}
add_filter( 'pmpromm_default_map_start', 'mypmromm_override_default_map_start', 10, 2 );
function mypmpromm_override_first_marker( $okay, $map_id ) {
return true;
}
add_filter( 'pmpromm_override_first_marker', 'mypmpromm_override_first_marker', 10, 2 );
@laurenhagan0306
Copy link

This recipe is included in the blog post on "Overriding The PMPro Membership Map Default Starting Point" at Paid Memberships Pro here: https://www.paidmembershipspro.com/overriding-the-pmpro-membership-map-default-starting-point/

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