Resumo de IA
Descrição
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.
Parâmetros
Esta ação não aceita nenhum parâmetro.
Mais Informações
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.
Fonte
wpforms-geolocation/src/Map.php
Exemplos
To find the latitude and longitude coordinates, please see this reference from Google.
/**
* Set the default lat and lng for the map.
*
* @link https://wpforms.com/developers/wpforms_geolocation_map_default_location/
* 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 );
Relacionado
Documentation Reference: How to Change Default Location for Geolocation Addon