Suppose I'm using a Theme which has a custom panel in the admin area, or I'm using a Plugin, has similar Admin menu button. But all such button are only visible to Administrator. When I'm loggin in from an editor account they are gone.

But I need them badly. I want an Editor can have access to those panels, and I want to let them the privilege.

In that case I'll need to know the theme's or plugin's specific ROLE's or CAPABILITIES' name and then I'll need to assign 'em to a certain user. But here comes the million dollar question:


    //suppose you have a custom role called 'architect' and you want to add a capability called `can access architect zone`
    global $wp_roles;
    $wp_roles->add_cap( 'architect', 'can_access_architect_zone' );

code cited from:this link

How can I assume that the plugin or theme uses the 'can_access_architect_zone' as its capability?

1 Answer 1


functions like add_submenu_page() ask for a capability when they are called, as in de code below:

add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function );

$capability contains the capability required for this menu to be displayed to the user.

When you want to know wich Roles and Capabilities are used in a theme or plugin, you could take a look in de code and search for these kind of functions.

Also, if you downloaded a theme or plugin, you could give it a try to search for this information on the developers website.

  • Thanks for your reply. I wonder how can I get the $parent_slug, $menu_slug from such a theme/plugin? I can hide the total menu by deleting or commenting out code like: add_action('init', 'slideshow_register');. But that's not the proper solution. When I'm clicking on the specific menu, it generates: wp-admin/edit.php?post_type=slideshow, I tried with the assumed slug "slideshow" and with "slideshow_register", but can't get the desired result. And $parent_slug, $menu_slug are REQUIRED. Jan 16, 2013 at 10:35
  • 1
    You're looking for capabilities of a registered post_type. In this case, you probably should take a look into the function slideshow_register and search in the arguments of the function register_post_type. In these arguments, search for the argument capabilities (more info about this here). There you'll have to find the capabilities you are looking for. Jan 16, 2013 at 11:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.