Redirect user to dedicated page based on user role while logged in
I’m trying to get a user to be redirected from one single core page (domain.com/my_account) based on their user role.
I am using the following plugins: Peter’s login redirect, Members
Although both plugins work in harmony, they have yet to complete this task.
User A = Role defined to access the Account page
User B = Role defined as a limited user therefore will be redirected to the warning page.
So if user A logs in and attempts to access the My Account page, it works fine.
If User B logs in, they are being redirected to the Warning page.
So far so good for the Login process and redirection after logging in.
But, if at some point, while the user is navigating the site and they are logged in as User B, if they click on the My Account link, they are redirected to the Homepage as it was set through the Peter’s redirect plugin, this does the job half way as ultimately I would like them to be redirected to the Warning page.
What I am trying to do is once the user is logged in, no matter where they are on the website, if they click on the My Account link, they will be redirected to their respective page based on their user role, not only after they login.
Is there a way to achieve this behaviour? I’m not a coder but I can find my way around when it comes to inserting code in Functions or the core theme.
Thank you for any assistance you may provide.
- The topic ‘Redirect user to dedicated page based on user role while logged in’ is closed to new replies.