Pull the values in WP_User::data directly into WP_User so that we don't have to do ->data->blah.

git-svn-id: https://develop.svn.wordpress.org/trunk@3102 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2005-11-16 02:54:23 +00:00
parent b8f0875533
commit 62f1fd972b
6 changed files with 65 additions and 64 deletions

View File

@@ -123,9 +123,13 @@ class WP_User {
if ( empty($this->data->ID) )
return;
$this->id = $this->data->ID;
foreach (get_object_vars($this->data) as $key => $value) {
$this->{$key} = $value;
}
$this->id = $this->ID;
$this->cap_key = $table_prefix . 'capabilities';
$this->caps = &$this->data->{$this->cap_key};
$this->caps = &$this->{$this->cap_key};
if ( ! is_array($this->caps) )
$this->caps = array();
$this->get_role_caps();
@@ -182,8 +186,8 @@ class WP_User {
function update_user_level_from_caps() {
global $table_prefix;
$this->data->user_level = array_reduce(array_keys($this->allcaps), array(&$this, 'level_reduction'), 0);
update_usermeta($this->id, $table_prefix.'user_level', $this->data->user_level);
$this->user_level = array_reduce(array_keys($this->allcaps), array(&$this, 'level_reduction'), 0);
update_usermeta($this->id, $table_prefix.'user_level', $this->user_level);
}
function add_cap($cap, $grant = true) {