Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wp-user-manager/e8ca68f2857999deeeaafa6600ba03d7 to your computer and use it in GitHub Desktop.
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
<?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 );
@wp-user-manager
Copy link
Author

Save this file to your /wp-content/mu-plugins/ directory (you might need to create the mu-plugins directory).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment