Support » Plugin: Admin Menu Editor » Add multiple user roles to menu item?

  • In the Required capability field for any of the menu items, if I add Editor there, it doesn’t allow the administrator to see it. Seems like it would take affect for that role and any others that are greater than it. I tried to type in 2 roles in the field, separated by a coma, but it doesnt work for the lesser role (example: “administrator, editor” doesnt allow the editor to see it, just the admin).

    CAN this work, having 2 roles in the field?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Janis Elsts


    No, in the free version, you can only have one capability or role in the field. In the Pro version, you can actually enter a comma-separated list, and it will work as you would expect (though there are easier ways to set role permissions in the Pro version).

    As to why adding Editor prevents Administrators from seeing the menu:

    While the default WP roles look like they form a clear hierarchy (i.e. Administrator is “greater” than Editor and so on), that’s not actually the case in general. For example, it would be entirely possible to create a custom role that has some capabilities that only Administrators have, but lacks some of the capabilities of an Editor.

    Overall, there is no general and reliable way to determine if a given role is lesser on greater than another – except for the default roles, that is, where the relations could be hard-coded (and even that could fail if the user was to edit the default roles). So entering a role ID in the “required capability” field will restrict the menu to that specific role.

    Plugin Author Janis Elsts


    Addendum: To make a menu visible to two roles, set its “required capability” field to a capability that both of those roles have. For Administrator and Editor, that would be “moderate_comments”, “edit_others_posts” or any other capability they share.

    See this table for the full list:

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add multiple user roles to menu item?’ is closed to new replies.