From 9a8391315a60ef9dbf70248c44c0ef54171a26f1 Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 20 Nov 2006 04:29:06 +0000 Subject: [PATCH] ID instead of id. Props Nazgul. fixes #3152 git-svn-id: http://svn.automattic.com/wordpress/trunk@4504 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/users.php | 8 ++++---- wp-includes/capabilities.php | 11 ++++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/wp-admin/users.php b/wp-admin/users.php index 5be1deeccd..8703f1ec55 100644 --- a/wp-admin/users.php +++ b/wp-admin/users.php @@ -135,7 +135,7 @@ case 'promote': if ( ! current_user_can('edit_user', $id) ) wp_die(__('You can’t edit that user.')); // The new role of the current user must also have edit_users caps - if($id == $current_user->id && !$wp_roles->role_objects[$_POST['new_role']]->has_cap('edit_users')) { + if($id == $current_user->ID && !$wp_roles->role_objects[$_POST['new_role']]->has_cap('edit_users')) { $update = 'err_admin_role'; continue; } @@ -169,7 +169,7 @@ case 'dodelete': if ( ! current_user_can('delete_user', $id) ) wp_die(__('You can’t delete that user.')); - if($id == $current_user->id) { + if($id == $current_user->ID) { $update = 'err_admin_del'; continue; } @@ -217,7 +217,7 @@ case 'delete': $go_delete = false; foreach ( (array) $userids as $id ) { $user = new WP_User($id); - if ( $id == $current_user->id ) { + if ( $id == $current_user->ID ) { echo "
  • " . sprintf(__('ID #%1s: %2s The current user will not be deleted.'), $id, $user->user_login) . "
  • \n"; } else { echo "
  • " . sprintf(__('ID #%1s: %2s'), $id, $user->user_login) . "
  • \n"; @@ -227,7 +227,7 @@ case 'delete': $all_logins = $wpdb->get_results("SELECT ID, user_login FROM $wpdb->users ORDER BY user_login"); $user_dropdown = ''; ?> diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php index b3dfe02687..2bce613658 100644 --- a/wp-includes/capabilities.php +++ b/wp-includes/capabilities.php @@ -130,7 +130,8 @@ class WP_Role { class WP_User { var $data; - var $id = 0; + var $ID = 0; + var $id = 0; // Deprecated, use $ID instead. var $caps = array(); var $cap_key; var $roles = array(); @@ -193,7 +194,7 @@ class WP_User { function add_role($role) { $this->caps[$role] = true; - update_usermeta($this->id, $this->cap_key, $this->caps); + update_usermeta($this->ID, $this->cap_key, $this->caps); $this->get_role_caps(); $this->update_user_level_from_caps(); } @@ -202,7 +203,7 @@ class WP_User { if ( empty($this->roles[$role]) || (count($this->roles) <= 1) ) return; unset($this->caps[$role]); - update_usermeta($this->id, $this->cap_key, $this->caps); + update_usermeta($this->ID, $this->cap_key, $this->caps); $this->get_role_caps(); } @@ -215,7 +216,7 @@ class WP_User { } else { $this->roles = false; } - update_usermeta($this->id, $this->cap_key, $this->caps); + update_usermeta($this->ID, $this->cap_key, $this->caps); $this->get_role_caps(); $this->update_user_level_from_caps(); } @@ -261,7 +262,7 @@ class WP_User { $cap = $this->translate_level_to_cap($cap); $args = array_slice(func_get_args(), 1); - $args = array_merge(array($cap, $this->id), $args); + $args = array_merge(array($cap, $this->ID), $args); $caps = call_user_func_array('map_meta_cap', $args); // Must have ALL requested caps $capabilities = apply_filters('user_has_cap', $this->allcaps, $caps, $args);