elegant themes

Allow Editor access level to add users in WordPress

| May 29, 2011 | 2 Comments

Recently, a client asked us to allow editors to add users on their WordPress site. They wanted this feature so that the site managers wouldn’t be tempted to click on any of the settings, and possibly mess something up. I know this is super specific but it did come up for us so maybe it will be relevant for you.

Here’s what I did:

  1. Install and activate the Members Plugin
  2. Go to Settings > Members Components and activate the Edit Roles component
  3. Go to Users > Roles. Click on Editor. In the options panel, check off create_users, edit_users, and delete_users.
  4. Add this code into your funcitons.php file.
  5. Test it out.
  6. That’s it.
0saves
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Category: Code Snippets, Plugins, Tips

About Rebecca Markowitz: Rebecca Markowitz has built over 50 WordPress sites for clients as Web Project Manager and WordPress specialist at illuminea. illuminea is a Jerusalem-based boutique web agency. WPGarage shows my dedicated relationship with WordPress over the years - full of love, laughs, tears, growth and strong drinks. L'chaim! View author profile.

solostream

Comments (2)

Trackback URL | Comments RSS Feed

  1. seanjacob says:

    $role_object = get_role(‘editor’);
    $role_object->add_cap(‘list_users’);

    //remove administrator
    function filter_editable_roles($roles) {
    global $current_user; get_currentuserinfo();
    if ($current_user->user_level != 10 ) {
    unset ($roles['administrator']);
    }
    return $roles;
    }
    add_filter(‘editable_roles’, ‘filter_editable_roles’);

Leave a Reply




If you want a picture to show with your comment, go get a Gravatar.

More in Code Snippets, Plugins, Tips (20 of 219 articles)