- This topic has 1 reply, 2 voices, and was last updated 14 years, 2 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- The forum ‘How do I …’ is closed to new topics and replies.
Events Made Easy › Forums › How do I … › Prevent Contributors from seeing the Events Menu
Tagged: How Do I
I am trying to remove the Events sidebar menu in the admin screen so contributors can’t add or edit events. I used the following code but it didn’t work:
function remove_menus () {
global $menu, $current_user;
if(in_array(‘contributor’, $current_user->roles) )
{
$restricted = array(__(‘Events’));
end ($menu);
while (prev($menu)){
$value = explode(‘ ‘,$menu[key($menu)][0]);
if(in_array($value[0] != NULL?$value[0]:”” , $restricted)){unset($menu[key($menu)]);}
}
}
}
add_action(‘admin_menu’, ‘remove_menus’);
Well, look at events-manager.php, it contains constant definitions at the top, amongst those are the ones for editing:
define(‘MIN_CAPABILITY’, ‘edit_posts’);
define(‘SETTING_CAPABILITY’, ‘activate_plugins’);
Play around with those …