Changeset 2793 for trunk/wp-includes/capabilities.php
- Timestamp:
- 08/20/2005 01:37:41 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/capabilities.php
r2735 r2793 65 65 function is_role($role) 66 66 { 67 return empty($this->role_names[$role]);67 return isset($this->role_names[$role]); 68 68 } 69 69 } … … 133 133 //Filter out caps that are not role names and assign to $this->roles 134 134 if(is_array($this->caps)) 135 $this->roles = array_filter( $this->caps, array(&$wp_roles, 'is_role'));135 $this->roles = array_filter(array_keys($this->caps), array(&$wp_roles, 'is_role')); 136 136 137 137 //Build $allcaps from role caps, overlay user's $caps 138 138 $this->allcaps = array(); 139 foreach($this->roles as $role => $value) {139 foreach($this->roles as $role) { 140 140 $role = $wp_roles->get_role($role); 141 141 $this->allcaps = array_merge($this->allcaps, $role->capabilities); … … 160 160 161 161 function set_role($role) { 162 foreach($this->roles as $oldrole => $value)162 foreach($this->roles as $oldrole) 163 163 unset($this->caps[$oldrole]); 164 164 $this->caps[$role] = true;
Note: See TracChangeset
for help on using the changeset viewer.