Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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:

  • HOW COME I FIND OUT A THEME'S OR PLUGIN'S SPECIFIC CAPABILITIES?

    //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?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
    
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. –  Mayeenul Islam Jan 16 '13 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. –  Mike Madern Jan 16 '13 at 11:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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