• Resolved Mark Dalderup

    (@2grafik)


    Hello,

    I am trying to give my editors access to the users list in the admin panel , I have added the following code to the function.php of my theme but it doesn’t seem to work

    function add_user_caps() {
        // gets the author role
        $role = get_role( 'editor' );
    
        // This only works, because it accesses the class instance.
        // would allow the author to edit others' posts for current theme only
        $role->add_cap( 'edit_users' );
    }
    add_action( 'admin_init', 'add_user_caps');

    but when I log in as editor I still cannot access the user list only the profile page, what am I doing wrong?

    Thanks and greetings Mark,

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator keesiemeijer

    (@keesiemeijer)

    Thread Starter Mark Dalderup

    (@2grafik)

    That plugin didn’t work,probably because of some conflict with another one but it did give me the term which I was looking for.

    Its not edit_users but list_users. Then the code above works.

    Its weird that list_users also gives you the capability to edit users but I am not complaining since this does exactly what I want.

    thanks for your help

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘show editor the user list’ is closed to new replies.