login_redirect WordPress Filter Hook
The login_redirect hook is used to specify the URL to which a user should be redirected after logging in. By default, users are redirected to the dashboard, but this hook can be used to redirect them to a specific page.
apply_filters( 'login_redirect', string $redirect_to , string $requested_redirect_to , WP_User|WP_Error $user ) #
Filters the login redirect URL.
Parameters
More Information
The $current_user
global may not be available at the time this filter is run. So you should use the $user
global or the $user
parameter passed to this filter.
Source
File: wp-login.php
Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |