Title: Using Multi Roles
Last modified: February 9, 2017

---

# Using Multi Roles

 *  Resolved [anymaa](https://wordpress.org/support/users/anymaa/)
 * (@anymaa)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/using-multi-roles/)
 * Hi,
 * I am trying this plugin with multi roles but, it’s take account of just primary
   role. How can i do this? I want to use second or third role.
 * Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [anymaa](https://wordpress.org/support/users/anymaa/)
 * (@anymaa)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/using-multi-roles/#post-8783917)
 * 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 9 years, 4 months ago by [anymaa](https://wordpress.org/support/users/anymaa/).
    -  This reply was modified 9 years, 4 months ago by [anymaa](https://wordpress.org/support/users/anymaa/).
    -  This reply was modified 9 years, 4 months ago by [anymaa](https://wordpress.org/support/users/anymaa/).
      Reason: Misspelling
 *  Plugin Author [Gyrix TechnoLabs](https://wordpress.org/support/users/priyankabhave/)
 * (@priyankabhave)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/using-multi-roles/#post-8964252)
 * Hi [@anymaa](https://wordpress.org/support/users/anymaa/),
    Thanks for your inputs.
   I will add your code to my plugin and after testing it, I will upload the updated
   plugin.
 * Thanks
 *  Plugin Author [Gyrix TechnoLabs](https://wordpress.org/support/users/priyankabhave/)
 * (@priyankabhave)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/using-multi-roles/#post-9073959)
 * Hi [@anymaa](https://wordpress.org/support/users/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

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Using Multi Roles’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/redirect-role-wise.svg)
 * [Redirect Role Wise](https://wordpress.org/plugins/redirect-role-wise/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/redirect-role-wise/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/redirect-role-wise/)
 * [Active Topics](https://wordpress.org/support/plugin/redirect-role-wise/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/redirect-role-wise/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/redirect-role-wise/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Gyrix TechnoLabs](https://wordpress.org/support/users/priyankabhave/)
 * Last activity: [9 years, 1 month ago](https://wordpress.org/support/topic/using-multi-roles/#post-9073959)
 * Status: resolved