Registration/lostpass errors showing on frontend
-
Hello, I’m using s2member, customized my registration form and now I’d like to show all errors on my frontend maked registration page. Here’s my code:
<?php $register = $_GET['register']; $reset = $_GET['reset']; if ($register == true) { ?> Message, when registered succesfully // it shows <?php } elseif ($reset == true) { ?> Message when lost password is ok // it shows <?php } else { } ?> // register form starts here <form method="post" action="<?php echo site_url('wp-login.php?action=register', 'login_post')?> //username <input type="text" aria-required="true" maxlength="100" autocomplete="off" name="user_login" id="user_login" class="user_login" value="<?php echo esc_attr(stripslashes($user_login)); ?>" tabindex="101"> //Email <input type="text" aria-required="true" autocomplete="off" name="user_email" id="user_email" class="user_email" value="<?php echo esc_attr(stripslashes($user_email)); ?>" tabindex="102"> //here wordpress takes the register_form customized in s2member <?php do_action('register_form'); ?><div id="reg-button"> <input type="submit" name="user-submit" value="register" class="user-submit" tabindex="103" /> <?php $register = $_GET['register']; if($register == true) { echo '<p>Check your email for the password!</p>'; } ?> <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>?register=true" /> <input type="hidden" name="user-cookie" value="1" /> </form> // now for the lost password <form method="post" action="<?php echo site_url('wp-login.php?action=lostpassword', 'login_post') ?>" class="wp-user-form"> //You type the login/email here <input type="text" name="user_login" value="" size="20" id="user_login" tabindex="1001" /> <?php do_action('login_form', 'resetpass'); ?> <input type="submit" name="user-submit" value="send pass" class="user-submit" tabindex="1002" /> <?php $reset = $_GET['reset']; if($reset == true) { echo '<p>A message will be sent to your email address.</p>'; } ?> <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>?reset=true" /> <input type="hidden" name="user-cookie" value="1" /> </form> <?php } ?>
Basically, I’d like to show below errors on the front end, like I can show success messages now. What I’m lacking is;
- Username (required / already used)
- Email (is it valid, required, used)
- I have WP reCaptcha plugin, and if there is no captcha typed or it is wrong, it redirects me to the wp-login
- When recovering lost password, you can either type wrong username/password.
Any ideas how I can do it?
Thanks!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Registration/lostpass errors showing on frontend’ is closed to new replies.