Get a user's role
-
Hi
I’m trying to edit this code so all users except Admins are redirected:
function cr_login_redirect_to_front_page() { global $current_user; get_currentuserinfo(); if ($current_user->roles[0] == 'subscriber') { wp_redirect('../'); echo '<meta http-equiv="refresh" content="0;URL=../" />'; echo '<script type="text/javascript"> <!-- window.location = "../" //--> </script>'; }
Currently it only works for subscribers. How can I change that?
Best regards
//Mads
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Get a user's role’ is closed to new replies.