Use APIs to Geolocate the user. Geolocation APIs can be added through the use of the woocommerce_geolocation_geoip_apis filter. Provide a name=>value pair for service-slug=>endpoint. If APIs are defined, one will be chosen at random to fulfil the request. After completing, the result will be cached in a transient.
self::$geoip_apis
Sortie :
@param string $ip_address IP address. @return string
// Modifier la valeur avec le filtre 'woocommerce_geolocation_geoip_apis'
add_filter('woocommerce_geolocation_geoip_apis', 'ma_fonction_filtre', 10, 1);
function ma_fonction_filtre(self::$geoip_apis) {
// Modifier la valeur
return self::$geoip_apis;
}
Chargement des actualités...