[wp-hackers] Best practice: custom registration form

Lox lox.dev at knc.nc
Wed Aug 11 16:43:39 UTC 2010

2010/8/12 Otto <otto at ottodestruct.com>

> If you need to intercept that on the back end to check for something
> and/or return a different response, then you can use the
> login_redirect filter, which gets the redirect_to value as the first
> parameter, and the resulting $user object as the second parameter. To
> check for a login failure at that point, you'd check for
> is_wp_error($user) and if it's true, you can output your error stuff
> and then exit() cleanly. No HTML response of any sort then, as far as
> I can see.
> BTW, since you asked, interim_login is used when a users session
> cookies expire. This almost never happens.

Thanks Otto, it is a nice trick. Unfortunately I have already duplicated the
whole wp-login.php to my plugin with AJAX... Also I had to change the
user_login field label. But in next project I'll take you approach.

I also had a look to registration_redirect filter witch unfortunately does
not get errors ... But i may be able to use the registration_errors filter.
(Also a wp_registration_form function is "missing")

Concerning password reset, I do not see any filter to catch errors...

I think the whole login/registration system in wordpress should be more

lox.dev at knc.nc

More information about the wp-hackers mailing list