Overwriting default redirects
-
Hi;
WPUM offers default redirect settings. Unfortunately they are general and not based on user role.
I added this code to the functions.php file to overwrite this but WPUM is ignoring this code.
function acme_login_redirect( $redirect_to, $request, $user ) { return ( is_array( $user->roles ) && in_array( 'administrator', $user->roles ) ) ? admin_url() : site_url(); } add_filter( 'login_redirect', 'acme_login_redirect', 10, 3 );
How can I set redirects per role so that admin goes to dashboard and other users go to homepage after logging in?
Thank you
Lode
The page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Overwriting default redirects’ is closed to new replies.