Changeset 3668

Show
Ignore:
Timestamp:
03/30/06 23:35:42 (3 years ago)
Author:
ryan
Message:

Move DB prefix dependent code to separate init routines that can be called independently when the prefix changes. These methods are for internal use only.

Files:

Legend:

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

    r3604 r3668  
    99 
    1010    function WP_Roles() { 
     11        $this->_init(); 
     12    } 
     13 
     14    function _init () { 
    1115        global $wpdb; 
    1216        $this->role_key = $wpdb->prefix . 'user_roles'; 
     
    1721            return; 
    1822 
     23        $this->role_objects = array(); 
     24        $this->role_names =  array(); 
    1925        foreach ($this->roles as $role => $data) { 
    2026            $this->role_objects[$role] = new WP_Role($role, $this->roles[$role]['capabilities']); 
     
    145151 
    146152        $this->id = $this->ID; 
     153        $this->_init_caps(); 
     154    } 
     155 
     156    function _init_caps() { 
     157        global $wpdb; 
    147158        $this->cap_key = $wpdb->prefix . 'capabilities'; 
    148159        $this->caps = &$this->{$this->cap_key};