diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-06-13 11:18:16 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-06-13 11:18:16 +0000 |
| commit | 19b51f30bd324ecb36f99d159947b75c22b6fecf (patch) | |
| tree | 9423e53c5fddbfca6e4cd05f43c4e1e11bc508b4 /wp-inst/wp-includes/capabilities.php | |
| parent | 242d432d82cefdf3aab7135b5298c2db02c9114c (diff) | |
WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@559 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-includes/capabilities.php')
| -rw-r--r-- | wp-inst/wp-includes/capabilities.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/wp-inst/wp-includes/capabilities.php b/wp-inst/wp-includes/capabilities.php index a1dfa56..3e85e4f 100644 --- a/wp-inst/wp-includes/capabilities.php +++ b/wp-inst/wp-includes/capabilities.php @@ -174,7 +174,7 @@ class WP_User { //Build $allcaps from role caps, overlay user's $caps $this->allcaps = array(); - foreach($this->roles as $role) { + foreach( (array) $this->roles as $role) { $role = $wp_roles->get_role($role); $this->allcaps = array_merge($this->allcaps, $role->capabilities); } @@ -199,8 +199,12 @@ class WP_User { function set_role($role) { foreach($this->roles as $oldrole) unset($this->caps[$oldrole]); - $this->caps[$role] = true; - $this->roles = array($role => true); + if ( !empty($role) ) { + $this->caps[$role] = true; + $this->roles = array($role => true); + } else { + $this->roles = false; + } update_usermeta($this->id, $this->cap_key, $this->caps); $this->get_role_caps(); $this->update_user_level_from_caps(); |
