The wpforms_geolocation_map_default_location filter fires when the single entry is loaded on the Entries screen and when the form loads when enabled using the WPForms Geolocation addon.


This action does not accept any parameters.

More Information

This filter is used to set the default longitude and latitude coordinates for the map used with the Geolocation addon. The map is viewed on the entries and on the forms.




To find the latitude and longitude coordinates, please see this reference from Google.

 * Set the default lat and lng for the map.
 * @link
 * return  array

function wpf_wpforms_geolocation_map_default_location() {
    return [
            'lat' => 51.5207,
            'lng' => -0.1550,
add_filter( 'wpforms_geolocation_map_default_location', 'wpf_wpforms_geolocation_map_default_location', 10 );

Documentation Reference: How to Change Default Location for Geolocation Addon