Created
May 9, 2020 08:03
-
-
Save wp-user-manager/e8ca68f2857999deeeaafa6600ba03d7 to your computer and use it in GitHub Desktop.
WP User Manager - Customize the error message when logging in with the incorrect password
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'wpum_form_error_message', function ( $message, $code ) { | |
if ( 'login_submit' === $code && false !== strpos( $message, 'the password you entered for the username' ) ) { | |
// Remove the username from the message | |
return __( '<strong>Error</strong>: The password you entered for the username is incorrect.' ) . ' <a href="' . wp_lostpassword_url() . '">' . __( 'Lost your password?' ) . '</a>'; | |
} | |
return $message; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Save this file to your /wp-content/mu-plugins/ directory (you might need to create the mu-plugins directory).