Skip to content

Commit

Permalink
delete user cap in remove_all_caps(), props ocean90, see #12711
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.automattic.com/wordpress/trunk@13883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
wpmuguru committed Mar 29, 2010
1 parent 3a69eac commit fbf3ee6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions wp-admin/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,10 @@
$user_object = new WP_User($userid);
$roles = $user_object->roles;
$role = array_shift($roles);

$style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"';
echo "\n\t", user_row( $user_object, $style, $role, $post_counts[ $userid ] );
if ( is_multisite() && ! empty($role) ) {
$style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"';
echo "\n\t", user_row( $user_object, $style, $role, $post_counts[ $userid ] );
}
}
?>
</tbody>
Expand Down
4 changes: 2 additions & 2 deletions wp-includes/capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -698,8 +698,8 @@ function remove_cap( $cap ) {
function remove_all_caps() {
global $wpdb;
$this->caps = array();
update_user_meta( $this->ID, $this->cap_key, '' );
update_user_meta( $this->ID, $wpdb->prefix . 'user_level', '' );
delete_user_meta( $this->ID, $this->cap_key );
delete_user_meta( $this->ID, $wpdb->prefix . 'user_level' );
$this->get_role_caps();
}

Expand Down

0 comments on commit fbf3ee6

Please sign in to comment.