November 21, 2019 at 3:35 am #80919
Keymaster
@ehi-kioya
Quick follow up.
Since you’re using the add_filter()
function, the anonymous function technique I mentioned above may not even be necessary (even though it should totally work).
An old-school named function like this should also accomplish the same goal:
function remove_login_errors( $error ) { return 'Error: Incorrect login details. Try again'; } add_filter( 'login_errors', 'remove_login_errors' );
In any case, create_function()
should still be avoided.
I think using anonymous functions as replacements for create_function()
became popular because developers wanted a one line replacement for a bad one line piece of code.