How to display error messages using WP_Error class?
With that in functions.php you’d probably have to declare $error to be global like so : if (‘POST’ == $_SERVER[‘REQUEST_METHOD’] && !empty($_POST[‘action’]) && $_POST[‘action’] == ‘registration’) { global $error; $error = new WP_Error(); // the rest of your code And then do global $error; again on your registration page before trying to use it. But … Read more