Use table prefix from wpdb. Props Mark J. #2524

git-svn-id: https://develop.svn.wordpress.org/trunk@3603 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2006-03-03 17:19:05 +00:00
parent e800b7823f
commit 4489be47f5
4 changed files with 28 additions and 28 deletions

View File

@@ -8,8 +8,8 @@ class WP_Roles {
var $role_key;
function WP_Roles() {
global $table_prefix;
$this->role_key = $table_prefix . 'user_roles';
global $wpdb;
$this->role_key = $wpdb->table_prefix . 'user_roles';
$this->roles = get_option($this->role_key);
@@ -121,7 +121,7 @@ class WP_User {
var $allcaps = array();
function WP_User($id, $name = '') {
global $table_prefix;
global $wpdb;
if ( empty($id) && empty($name) )
return;
@@ -144,7 +144,7 @@ class WP_User {
}
$this->id = $this->ID;
$this->cap_key = $table_prefix . 'capabilities';
$this->cap_key = $wpdb->table_prefix . 'capabilities';
$this->caps = &$this->{$this->cap_key};
if ( ! is_array($this->caps) )
$this->caps = array();
@@ -205,9 +205,9 @@ class WP_User {
}
function update_user_level_from_caps() {
global $table_prefix;
global $wpdb;
$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);
update_usermeta($this->id, $wpdb->table_prefix.'user_level', $this->user_level);
}
function add_cap($cap, $grant = true) {