I have a WP site whereby i send customers an email with a link to /my-quotes/ this then, has the following code:
<?
if (!is_user_logged_in()): ?>
<meta http-equiv="refresh" content="0;URL=<? echo wp_login_url(get_permalink()); ?>">
<? endif; ?>
What i want to do is, give the link in the email like:
/my-quotes/?login=myusername
and that ‘myusername’ is the login fields value to save the user re-typing it.
I’ve had a look in wp-login.php and cant work out where to populate the login fields using $_GET, can anyone advise on a solution?
Thanks in advance.
You should do it by hooking in to the
login_form
action, rather than modifying wp-login.php, which will get overwritten at next update.You can add this code to your theme’s
functions.php
file:Then update your code to include the variable:
If the jQuery footprint is too much, you can achieve the same with JavaScript: