Title: Problems with multiple roles
Last modified: February 27, 2026

---

# Problems with multiple roles

 *  [Bob](https://wordpress.org/support/users/prasunsen/)
 * (@prasunsen)
 * [3 months, 2 weeks ago](https://wordpress.org/support/topic/problems-with-multiple-roles/)
 * Hello,
 * Thank you for this great plugin. Unfortunately there is a problem with users 
   having multiple roles and the admin links. It seems that the plugin takes the
   first role and bases its logic on it:
 * in wp-content/plugins/white-label-cms/includes/Functions.php
   function wlcms_current_user_roles(){
   $roles = wp_get_current_user()->roles;$role = array_shift($roles);return $role;}
 * Example, we have two users with these roles:
   User A:
 * array(
   ‘administrator’ => true,‘forum_central_office’ => true,‘central_office’
   => true,)
 * User B:
 * array(
   ‘central_office’ => true,‘administrator’ => true,‘forum_central_office’
   => true,)
 * The plugin works correctly for the second user but not for the first. 
   After 
   rearranging the roles of the first user like the second, the menus started working
   correctly.Perhaps an easy solution would be to allow a hook so we can rearrange
   the role priority:
 * function wlcms_current_user_roles()
   {$user = wp_get_current_user();$roles = (
   array) $user->roles;
 *     ```wp-block-code
       $role = $roles[0] ?? '';
   
       /**
        * Allow overriding the "primary" role used by WLCMS when user has multiple roles.
        *
        * @param string   $role  Selected role (default: first role).
        * @param string[] $roles All user roles.
        * @param WP_User  $user  Current user.
        */
       return apply_filters('wlcms_primary_role', $role, $roles, $user);
       ```
   
 * }

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fproblems-with-multiple-roles%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/white-label-cms/assets/icon-256x256.png?rev=1977768)
 * [White Label CMS](https://wordpress.org/plugins/white-label-cms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/white-label-cms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/white-label-cms/)
 * [Active Topics](https://wordpress.org/support/plugin/white-label-cms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/white-label-cms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/white-label-cms/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Bob](https://wordpress.org/support/users/prasunsen/)
 * Last activity: [3 months, 2 weeks ago](https://wordpress.org/support/topic/problems-with-multiple-roles/)
 * Status: not resolved