Redirecting users to custom Dashboard based on User role
This is an extended mod for Redirecting users based on their roles, I'm missing the code in the tpl-dashboard.php file to complete this mod.
I'm using Members plugin to assign a default role named (Viewers) to those looking to contact the advertisers on the site (Contact tab is displayed to logged in members only).
I also used the plugin (Peter's redirect plugin) to force those type of users (Viewers) to be redirected to a custom tpl-viewers.php (stripped out the links to post ads in the custom sidebar (sidebar-viewers.php) that I have also created.
Now, everything works great, Viewers login to the site and are automatically redirected to
www.site.com/viewers where the Viewers template is loaded (allowing them to update their basic profile if need be) while Contributors are logged in to the default Dashboard allowing them to post ads.
The problem is the Dashboard link in the top menu, I need to implement a code (I think it should go in the tpl-dashboard.php) that will identify the User role and pending on that user role to redirect them back to
www.site.com/viewers if they are set as "Viewers" or default link
www.site.com/add-new if they are set as "Contributors".
Anyone have any idea or tried implementing such a modification?