I have registration form code in my functions.php
file like this
if ('POST' == $_SERVER['REQUEST_METHOD'] && !empty($_POST['action']) && $_POST['action'] == 'registration') {
$error = new WP_Error();
if (empty(esc_attr($_POST['email'])))
{
$error->add('regerror','Email is required.');
}
if (!is_email(esc_attr($_POST['email'])))
{
$error->add('regerror','Invalid email format.');
}
if (email_exists(esc_attr($_POST['email'])))
{
$error->add('regerror','Email already in use. Did you forget your Password? If yes click here to reset.');
}
}
Now can someone tell me how to display those error messages in my register page
?
Update:
My registration page has code like this
<form method="post" action="<?php the_permalink(); ?>">
<!-- form fields goes here -->
<input name="action" type="hidden" value="registration" />
<input type="submit" id="submit" value="Register">
</form>