@bravoechon, you could do it yourself – something like (sorry it’s q&d):
add_action( 'wp_ajax_wpst_get_country', 'wpst_get_country' );
function wpst_get_country() {
if(function_exists('geoip_detect2_get_info_from_current_ip'))
$userInfo = geoip_detect2_get_info_from_current_ip();
echo json_encode(array(
'country' => $userInfo->country->name,
'country_code' => $userInfo->country->isoCode,
'city' => $userInfo->city->name,
));
wp_die();
}
and a jQuery-function like:
jQuery(document).ready(function($){
// Bei Formularen automatisch das Land ausw?hlen (abh?ngig von IP)
jQuery('.select-land').each(function (event) {
jQuery.ajax({
url : 'https://yourdomain.com/wp-admin/admin-ajax.php',
type : 'post',
dataType : 'json',
data : {
action : 'wpst_get_country'
},
error : function(jqXHT, textStatus, errorThrown) {
console.log('Landabfrage gescheitert');
},
success : function(response) {
console.log(response);
}
});
});
});
… and yes, you should not use the absolute path to admin-ajax.php ??