- Joined
- Sep 12, 2019
- Messages
- 2
- Reaction score
- 0
JavaScript:
jQuery( document ).ready( function () {
if ( 0 != jQuery( '#loginform' ).length ) {
jQuery( '#loginform' ).attr( 'action', '<?php echo esc_js( $post_url ) ?>' );
jQuery( '#loginform .login-password' ).remove();
jQuery( '#loginform' ).append( '<input type="hidden" name="action" value="send_passwordless_email">' );
jQuery( '#loginform .login-username label' ).text( 'Email' );
jQuery( '#loginform .login-username input' ).attr( 'name', 'user_login' );
jQuery( '#loginform .login-submit input.button' ).val( 'Email me my link' );
var url_string = window.location.href;
var url = new URL(url_string);
var email = url.searchParams.get("email");
var notfound = url.searchParams.get("notfound");
if ( null != email ) {
jQuery( '#loginform .login-username input' ).val( email );
var html = '';
if ( notfound ) {
html += '<b style="color:red">We could not find a user with an email ' + email +' </b><br>';
html += 'Please register for a FREE new account using the orange button.'
} else {
html += '<b>Please check your email</b><br>';
html += 'We have sent an email to you (' + email + ').<br>';
html += 'It will have a Link that will log you in';
}
jQuery( '#loginform' ).append( '<div id="login_popup"><p>' + html + '</p></div>' );
}
}
} );
Last edited by a moderator: