Skip to content

Instantly share code, notes, and snippets.

@whyisjake
Created November 2, 2013 00:21
Show Gist options
  • Save whyisjake/7273977 to your computer and use it in GitHub Desktop.
Save whyisjake/7273977 to your computer and use it in GitHub Desktop.
Let an editor add users.
<?php
/**
* Let editor manage users
*/
function make_allow_editor_to_add_users() {
$edit_editor = get_role( 'editor' );
$edit_editor->add_cap( 'list_users' );
$edit_editor->add_cap( 'create_users' );
$edit_editor->add_cap( 'delete_users' );
}
add_action( 'admin_init', 'make_allow_editor_to_add_users' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment