From 049fcf5b466e0ba51c52373b3e575b50ea4d9a9a Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Mon, 29 Mar 2010 20:35:06 +0000 Subject: [PATCH] delete user cap in remove_all_caps(), props ocean90, see #12711 git-svn-id: https://develop.svn.wordpress.org/trunk@13883 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/users.php | 7 ++++--- wp-includes/capabilities.php | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/wp-admin/users.php b/wp-admin/users.php index 83ed449eef..9860cc033d 100644 --- a/wp-admin/users.php +++ b/wp-admin/users.php @@ -368,9 +368,10 @@ foreach ( $wp_user_search->get_results() as $userid ) { $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 ] ); + } } ?> diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php index 774396ba1e..f19d4fbf1c 100644 --- a/wp-includes/capabilities.php +++ b/wp-includes/capabilities.php @@ -698,8 +698,8 @@ class WP_User { 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(); }