Generate Token location based WordPress Login and Register form

<p id=”demo”></p>

var x = document.getElementById(“demo”);

function getLocation() {
if (navigator.geolocation) {
var latitude =;
alert(‘Latitude is’ + latitude.tofixed(5));

} else {
x.innerHTML = “Geolocalizão não ativada em seu navegador.”;

function showPosition(position) {
x.innerHTML = “<input type=’text’ name=’lat’ class=’form0′ size=’8′ maxlength=’8′ readonly value='” + position.coords.latitude.toFixed(2) + “‘ required> <input type=’text’ name=’long’ class=’form0′ maxlenght=’7′ readonly value='” + position.coords.longitude.toFixed(2) + “‘ required><input type=’text’ name=’login’ class=’form0′ placeholder=’Login:’ required><input type=’password’ name=’senha’ class=’form0′ placeholder=’Senha:’ required><input type=’submit’ class=’acessar’ value=’ACESSAR PORTAL’>”;

I have this code to get the latitude and longitude from browser. I need to implement this on WordPress login and register page. Where the “token” has to be the same generated by the user on the register page.

If you guys have any idea to do this, share it with the comunity!

Thank you so much!

Read more here:: Generate Token location based WordPress Login and Register form

Leave a Reply

Your email address will not be published. Required fields are marked *