Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

wordpress remove user roles

//REMOVE UNUSED ROLES 
add_action('admin_menu', 'remove_built_in_roles');
 function remove_built_in_roles() {
    global $wp_roles;
    $roles_to_remove = array('subscriber', 'contributor', 'author', 'editor');
    foreach ($roles_to_remove as $role) {
        if (isset($wp_roles->roles[$role])) {
            $wp_roles->remove_role($role);
        }
    }
}
Source by www.role-editor.com #
 
PREVIOUS NEXT
Tagged: #wordpress #remove #user #roles
ADD COMMENT
Topic
Name
8+3 =