Thread Starter
anymaa
(@anymaa)
Hi,
You can update your code with this,
In includes/front-end-redirection.php
I added after 31. line
$current_roles1 = $current_user->roles[1];
$current_roles2 = $current_user->roles[2];
$current_roles3 = $current_user->roles[3];
$current_roles4 = $current_user->roles[4];
And i added after 52. line
if(in_array($current_roles1, $the_rrw_roles ))
{
$destination = $post->post_name;
$destination_url = get_permalink($destination);
header("Location:".$destination_url); /* Redirect user */
}
if(in_array($current_roles2, $the_rrw_roles ))
{
$destination = $post->post_name;
$destination_url = get_permalink($destination);
header("Location:".$destination_url); /* Redirect user */
}
if(in_array($current_roles3, $the_rrw_roles ))
{
$destination = $post->post_name;
$destination_url = get_permalink($destination);
header("Location:".$destination_url); /* Redirect user */
}
if(in_array($current_roles4, $the_rrw_roles ))
{
$destination = $post->post_name;
$destination_url = get_permalink($destination);
header("Location:".$destination_url); /* Redirect user */
}
Now it can be read first 5 role by users.
Thank you 🙂
-
This reply was modified 7 years, 2 months ago by anymaa.
-
This reply was modified 7 years, 2 months ago by anymaa.
-
This reply was modified 7 years, 2 months ago by anymaa. Reason: Misspelling
Hi @anymaa,
Thanks for your inputs. I will add your code to my plugin and after testing it, I will upload the updated plugin.
Thanks
Hi @anymaa,
I have uploaded a new version of the plugin i.e 1.2, which gives the option for adding redirection rules for Multi-Roles users. Please update your site’s plugin and check if it works for you.
Thanks