function my_custom_error_messages( $error ) {
global $errors;
$err_codes = $errors->get_error_codes();
// Invalid username.
// Default: '<strong>ERROR</strong>: Invalid username. <a href="%s">Lost your password</a>?'
if ( in_array( 'invalid_username', $err_codes ) ) {
$error = 'Oops, it looks like the username you is not valid. Please double-check and try again.';
}
// Incorrect password.
// Default: '<strong>ERROR</strong>: The password you entered for the username <strong>%1$s</strong> is incorrect. <a href="%2$s">Lost your password</a>?'
if ( in_array( 'incorrect_password', $err_codes ) ) {
$error = 'Uh oh, the password seems not right. Please double-check your password and retry.';
}
return $error;
};
add_filter( 'login_errors', 'my_custom_error_messages' );
inside the function.php under the child theme, but that didn’t seem to take effect?