How to add Wp_error using lostpassword_post hook when validating custom field?
As of WordPress 4.4, the action lostpassword_post passes the $errors object: function wpse_185243_lastpassword_post( $errors ) { if ( ! $captcha_valid /* The result of your captcha */ ) { $errors->add( ‘invalid_captcha’, ‘<strong>ERROR:</strong> Try again sonny.’ ); } } add_action( ‘lostpassword_post’, ‘wpse_185243_lastpassword_post’ ); Pre 4.4 legacy answer Here’s the relevant code you’re referring to (retrieve_password() in … Read more