Description

Fires when the single entry is loaded on the Entries screen and when the form loads when enabled using the WPForms Geolocation addon.

Parameters

This action does not accept any parameters.

More Information

This filter is used to set the language for the Algolia Places map when used with the Geolocation addon. The map is viewed on the individual entries and on the forms (if enabled).

Source

wpforms-geolocation/src/PlacesProviders/AlgoliaPlaces.php

Examples

To find two letter language code, please see this reference page.

/**
 * Change language for Algolia Places using WPForms Geolocation addon.
 *
 * @link   https://wpforms.com/developers/wpforms_geolocation_place_providers_algolia_places_get_language/
 *
 * return  string
 */

function wpf_wpforms_geolocation_place_providers_algolia_places_get_language() {
   
   // Use the 2 letters of your language. https://www.sitepoint.com/iso-2-letter-language-codes/
   // Try to get the current language and if it is impossible, use English.
   return 'de';
     
}
add_filter( 'wpforms_geolocation_place_providers_algolia_places_get_language', 'wpf_wpforms_geolocation_place_providers_algolia_places_get_language', 10);

Tutorial Reference: How to Change Default Location for Geolocation Addon