[wp-hackers] Change Login Error Message

Johan Eenfeldt johan.eenfeldt at gmail.com
Sat Dec 11 21:40:30 UTC 2010


On Sat, Dec 11, 2010 at 7:00 PM, Ryan Bilesky <rbilesky at gmail.com> wrote:
> I have a MS install, in wp-includes/users.php line 94, if the user account
> has been marked as a spammer, an error message is displayed saying the
> account has been marked as a spammer. However I would like to change the
> message to something more generic like your account has been banned.  Given
> that this is handled by the WP Errors class I'm not sure how to change it
> via a plugin.  Any help is much appreciated.

The error object is produced by the "authenticate" filter and
wp_authenticate_username_password(). If you hook into that filter with
a later priority, you can check the error object and change it
accordingly.

You can also use the "login_errors" filter (which is called in
wp-login.php) though unfortunately that is the error string to be
shown, so you would have to do some (error prone) string matching.

/ Johan


More information about the wp-hackers mailing list