set_role($_POST['new_role']); } header('Location: users.php?update=promote'); break; case 'dodelete': check_admin_referer(); if (empty($_POST['users'])) { header('Location: users.php'); } if ( !current_user_can('edit_users') ) die(__('You can’t delete users.')); $userids = $_POST['users']; foreach($userids as $id) { switch($_POST['delete_option']) { case 'delete': wp_delete_user($id); break; case 'reassign': wp_delete_user($id, $_POST['reassign_user']); break; } } header('Location: users.php?update=del'); break; case 'delete': check_admin_referer(); if (empty($_POST['users'])) { header('Location: users.php'); } if ( !current_user_can('edit_users') ) $error['edit_users'] = __('You can’t delete users.'); $userids = $_POST['users']; include ('admin-header.php'); ?>
get_col("SELECT ID FROM $wpdb->users;"); foreach($userids as $userid) { $tmp_user = new WP_User($userid); $roles = $tmp_user->roles; $role = $roles[0]; $roleclasses[$role][$tmp_user->data->user_login] = $tmp_user; } ?>