When a user enters wrong username/email or password in the login form, I want them to see "Invalid username/email or password." error message. That's easy to do with the following code:
add_filter('login_errors', create_function('$a', "return '<b>Error:</b> Invalid username/email or password.';"));
But with this code, the error message is displayed also in the lost password form. And the part with the wrong password doesn't make sense here, because you enter only username or email.
I found this https://wordpress.org/support/topic/password-reset-message-if-user-is-invalid/ but since I don't code, I don't know how to use it or even if it's possible.
Would anyone know how to do this?
create_function
will generate errors on newer versions of PHP, you should switch away from that style of code, though by usingcreate_function
you're actually overcomplicating how it works and making things harder