Events Made Easy Forums How do I … Prevent Contributors from seeing the Events Menu

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #42056
    Anonymous
    Inactive

    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’);

    #44572
    Franky
    Keymaster

    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 …

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘How do I …’ is closed to new topics and replies.
Scroll to Top