Opened 15 years ago
Closed 15 years ago
#12282 closed enhancement (fixed)
Redirect option after registration and password recovery
Reported by: | usermrpapa | Owned by: | |
---|---|---|---|
Milestone: | 3.0 | Priority: | normal |
Severity: | normal | Version: | 2.9.2 |
Component: | Users | Keywords: | has-patch, tested |
Focuses: | Cc: |
Description
we get a lot of user requests (and would be handy indeed) for a redirect after a registration or password recovery form as an option to reloading the login page. This would be similar to the filter or redirect ability on the login page itself.
Attachments (4)
Change History (19)
#7
@
15 years ago
What are you trying to do here:
if ( isset( $_REQUEST['redirect_to'] ) ) { $redirect_to = $_REQUEST['redirect_to']; } else { $redirect_to = ''; } $redirect_to = apply_filters('registration_redirect', $redirect_to, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '');
Looks like that should all just be:
$redirect_to = apply_filters( 'registration_redirect', isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '' );
#8
@
15 years ago
well, its really just trying to mimic the redirection allowed on the login form. I want to be able to redirect on registration or lost password forms rather than reloading the wp-login.php file. also wanted to allow filtering of the redirect.
it seemed a bit convoluted to me, but tried to mimic the login form redirection...
#9
follow-up:
↓ 10
@
15 years ago
- Keywords tested added
nacin, does that make sense? better way? as I said, this works for me, but may not be the most elegant solution.
#10
in reply to:
↑ 9
@
15 years ago
Replying to usermrpapa:
nacin, does that make sense? better way? as I said, this works for me, but may not be the most elegant solution.
Check to see how the attached patch works.
#11
@
15 years ago
No, that doesnt work - at least not like it does for login redirection.
Thats because when the form (register or lost password) is loaded, the hidden input redirect_to will always be empty, unless the redirect filter is used. Any $_REQUESTredirect_to? (ie query arg on the url) is ignored. The login redirect checks for the $_REQUEST before the filters and sets $redirect_to to the $_REQUEST if its there. That way a redirection can be accomplished without using a filter. Thats what some of the stuff you removed from my patch (yours looks cleaner, btw) did.
Now, since there is a filter applied, this can be made to work, just pointing out that it functions a bit differently than the standard login redirection. On login, you can redirect simply with the url. With this patch, you cannot for registration or lost password.
#12
@
15 years ago
Sorry,
$redirect_to = apply_filters( 'registration_redirect', isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '' );
Should be:
$redirect_to = apply_filters( 'registration_redirect', isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '' );
Patch refreshed in a moment.
patch for allowing redirection instead of going to wp-login.php on password reset and registration... obviously the wp messages wont display, that would be up to the redirection receiver...
patch from R13356