Opened 12 years ago
Closed 11 years ago
#27617 closed enhancement (fixed)
Introduce a `logout_redirect` filter
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 4.2 | Priority: | normal |
| Severity: | minor | Version: | 2.6 |
| Component: | Login and Registration | Keywords: | has-patch |
| Focuses: | Cc: |
Description
The login_redirect filter is applied to the redirect URL when a user logs in. There is no corresponding filter applied to the redirect URL when a user logs out.
Attachments (2)
Change History (9)
#2
@
12 years ago
Why not, but you already can do this, even if it's a little tricky:
add_filter( 'wp_redirect', 'logout_redirect_filter' );
function logout_redirect_filter( $location ) {
if ( isset( $_REQUEST['action'], $_REQUEST['redirect_to'] ) && 'logout' == $_REQUEST['action'] ) {
$location = home_url( '/my-own-url/' );
}
return $location;
}
Thoughts?
#4
@
11 years ago
I don't really have a problem with this, though I wonder if perhaps we should pass both the original value of redirect_to as well as the derived fallback, just as we do in the login_redirect filter.
#6
@
11 years ago
27617.2.patch passes the original 'redirect_to' value as well.
Note: See
TracTickets for help on using
tickets.
Thoughts?