Make WordPress Core


Ignore:
Timestamp:
11/16/2005 02:54:23 AM (20 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/capabilities.php

    r2904 r3102  
    124124            return;
    125125
    126         $this->id = $this->data->ID;
     126        foreach (get_object_vars($this->data) as $key => $value) {
     127            $this->{$key} = $value;
     128        }
     129
     130        $this->id = $this->ID;
    127131        $this->cap_key = $table_prefix . 'capabilities';
    128         $this->caps = &$this->data->{$this->cap_key};
     132        $this->caps = &$this->{$this->cap_key};
    129133        if ( ! is_array($this->caps) )
    130134            $this->caps = array();
     
    183187    function update_user_level_from_caps() {
    184188        global $table_prefix;
    185         $this->data->user_level = array_reduce(array_keys($this->allcaps),  array(&$this, 'level_reduction'), 0);
    186         update_usermeta($this->id, $table_prefix.'user_level', $this->data->user_level);
     189        $this->user_level = array_reduce(array_keys($this->allcaps),    array(&$this, 'level_reduction'), 0);
     190        update_usermeta($this->id, $table_prefix.'user_level', $this->user_level);
    187191    }
    188192   
Note: See TracChangeset for help on using the changeset viewer.