#7002 closed defect (bug) (fixed)
Can't control where a user redirects to when they log in
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 2.6.2 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | General | Keywords: | has-patch needs-testing |
| Focuses: | Cc: |
Description
The 'login' case in wp-login FIRST sets $redirect_to THEN runs wp_signon(). If we switch that, a plugin could hook into wp_signon's wp_login hook, and set $_REQUESTredirect_to? based on user type, capabilities, name, etc. It would be nice, and there is no downside that I see.
Attachments (2)
Change History (14)
#5
@
17 years ago
- Milestone changed from 2.6 to 2.6.2
- Resolution fixed deleted
- Status changed from closed to reopened
#7
@
17 years ago
How about a login_redirect filter called after wp_login(). Altering the redirect before login can mess up the SSL detection stuff. See patch.
#8
@
17 years ago
That's fine. I don't think we really need to pass $_REQUEST['redirect_to'] since the only difference would be https vs http right? I would be ok with this:
$redirect_to = apply_filters('login_redirect', $redirect_to, $user);
However, extra data doesn't hurt I suppose. Also, in the 2.6 branch if $_REQUEST['redirect_to'] is set then $_REQUEST['redirect_to'] and $redirect_to are identical.
(In [7958]) Relocate signon to the top. Props AaronCampbell. fixes #7002