Ticket #15458: 15458.2.diff
File 15458.2.diff, 8.7 KB (added by , 13 years ago) |
---|
-
wp-signup.php
213 213 $meta = apply_filters( 'signup_create_blog_meta', array( 'lang_id' => 1, 'public' => $public ) ); // deprecated 214 214 $meta = apply_filters( 'add_signup_meta', $meta ); 215 215 216 wpmu_create_blog( $domain, $path, $blog_title, $current_user-> id, $meta, $wpdb->siteid );216 wpmu_create_blog( $domain, $path, $blog_title, $current_user->ID, $meta, $wpdb->siteid ); 217 217 confirm_another_blog_signup($domain, $path, $blog_title, $current_user->user_login, $current_user->user_email, $meta); 218 218 return true; 219 219 } -
wp-login.php
586 586 587 587 if ( ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) ) { 588 588 // If the user doesn't belong to a blog, send them to user admin. If the user can't edit posts, send them to their profile. 589 if ( is_multisite() && !get_active_blog_for_user($user-> id) && !is_super_admin( $user->id) )589 if ( is_multisite() && !get_active_blog_for_user($user->ID) && !is_super_admin( $user->ID ) ) 590 590 $redirect_to = user_admin_url(); 591 591 elseif ( is_multisite() && !$user->has_cap('read') ) 592 $redirect_to = get_dashboard_url( $user-> id);592 $redirect_to = get_dashboard_url( $user->ID ); 593 593 elseif ( !$user->has_cap('edit_posts') ) 594 594 $redirect_to = admin_url('profile.php'); 595 595 } -
wp-includes/user.php
1566 1566 1567 1567 // Update the cookies if the password changed. 1568 1568 $current_user = wp_get_current_user(); 1569 if ( $current_user-> id== $ID ) {1569 if ( $current_user->ID == $ID ) { 1570 1570 if ( isset($plaintext_pass) ) { 1571 1571 wp_clear_auth_cookie(); 1572 1572 wp_set_auth_cookie($ID); -
wp-includes/capabilities.php
360 360 /** 361 361 * User data container. 362 362 * 363 * This will be set as properties of the object.364 *365 363 * @since 2.0.0 366 364 * @access private 367 365 * @var array … … 378 376 var $ID = 0; 379 377 380 378 /** 381 * The deprecated user's ID.382 *383 * @since 2.0.0384 * @access public385 * @deprecated Use WP_User::$ID386 * @see WP_User::$ID387 * @var int388 */389 var $id = 0;390 391 /**392 379 * The individual capabilities the user has been given. 393 380 * 394 381 * @since 2.0.0 … … 471 458 * @return WP_User 472 459 */ 473 460 function __construct( $id, $name = '', $blog_id = '' ) { 474 475 461 if ( empty( $id ) && empty( $name ) ) 476 462 return; 477 463 … … 488 474 if ( empty( $this->data->ID ) ) 489 475 return; 490 476 491 foreach ( get_object_vars( $this->data ) as $key => $value ) { 492 $this->{$key} = $value; 477 $this->ID = $this->data->ID; 478 $this->for_blog( $blog_id ); 479 } 480 481 /** 482 * Magic method for checking the existance of a certain custom field 483 * 484 * @since 3.3.0 485 */ 486 function __isset( $key ) { 487 return isset( $this->data->$key ); 488 } 489 490 /** 491 * Magic method for accessing custom fields 492 * 493 * @since 3.3.0 494 */ 495 function __get( $key ) { 496 if ( 'id' == $key ) { 497 _deprecated_argument( 'WP_User->id', '2.1', __( 'Use <code>WP_User->ID</code> instead.' ) ); 498 return $this->ID; 493 499 } 494 500 495 $this->id = $this->ID; 496 $this->for_blog( $blog_id ); 501 return $this->data->$key; 497 502 } 498 503 499 504 /** 505 * Magic method for setting custom fields 506 * 507 * @since 3.3.0 508 */ 509 function __set( $key, $value ) { 510 $this->data->$key = $value; 511 } 512 513 /** 500 514 * Set up capability object properties. 501 515 * 502 516 * Will set the value for the 'cap_key' property to current database table … … 511 525 */ 512 526 function _init_caps( $cap_key = '' ) { 513 527 global $wpdb; 528 514 529 if ( empty($cap_key) ) 515 530 $this->cap_key = $wpdb->prefix . 'capabilities'; 516 531 else 517 532 $this->cap_key = $cap_key; 518 $this->caps = &$this->{$this->cap_key}; 533 534 $this->caps = &$this->data->{$this->cap_key}; 519 535 if ( ! is_array( $this->caps ) ) 520 536 $this->caps = array(); 537 521 538 $this->get_role_caps(); 522 539 } 523 540 … … 956 973 case 'add_post_meta': 957 974 $post = get_post( $args[0] ); 958 975 $post_type_object = get_post_type_object( $post->post_type ); 959 $caps = map_meta_cap( $post_type_object->cap->edit_post, $user_id, $post->ID ); 976 $caps = map_meta_cap( $post_type_object->cap->edit_post, $user_id, $post->ID ); 960 977 961 $meta_key = isset( $args[ 1 ] ) ? $args[ 1 ] : false; 962 978 $meta_key = isset( $args[ 1 ] ) ? $args[ 1 ] : false; 979 963 980 if ( $meta_key && has_filter( "auth_post_meta_{$meta_key}" ) ) { 964 981 $allowed = apply_filters( "auth_post_meta_{$meta_key}", false, $meta_key, $post->ID, $user_id, $cap, $caps ); 965 982 if ( ! $allowed ) … … 1080 1097 return false; 1081 1098 1082 1099 // Create new object to avoid stomping the global current_user. 1083 $user = new WP_User( $current_user-> id) ;1100 $user = new WP_User( $current_user->ID) ; 1084 1101 1085 1102 // Set the blog id. @todo add blog id arg to WP_User constructor? 1086 1103 $user->for_blog( $blog_id ); … … 1225 1242 else 1226 1243 $user = wp_get_current_user(); 1227 1244 1228 if ( empty( $user-> id) )1245 if ( empty( $user->ID ) ) 1229 1246 return false; 1230 1247 1231 1248 if ( is_multisite() ) { -
wp-includes/pluggable.php
783 783 function is_user_logged_in() { 784 784 $user = wp_get_current_user(); 785 785 786 if ( $user-> id== 0 )786 if ( $user->ID == 0 ) 787 787 return false; 788 788 789 789 return true; … … 1308 1308 */ 1309 1309 function wp_verify_nonce($nonce, $action = -1) { 1310 1310 $user = wp_get_current_user(); 1311 $uid = (int) $user-> id;1311 $uid = (int) $user->ID; 1312 1312 1313 1313 $i = wp_nonce_tick(); 1314 1314 … … 1334 1334 */ 1335 1335 function wp_create_nonce($action = -1) { 1336 1336 $user = wp_get_current_user(); 1337 $uid = (int) $user-> id;1337 $uid = (int) $user->ID; 1338 1338 1339 1339 $i = wp_nonce_tick(); 1340 1340 -
wp-admin/users.php
216 216 $update = 'remove'; 217 217 foreach ( $userids as $id ) { 218 218 $id = (int) $id; 219 if ( $id == $current_user-> id&& !is_super_admin() ) {219 if ( $id == $current_user->ID && !is_super_admin() ) { 220 220 $update = 'err_admin_remove'; 221 221 continue; 222 222 } … … 269 269 foreach ( $userids as $id ) { 270 270 $id = (int) $id; 271 271 $user = new WP_User($id); 272 if ( $id == $current_user-> id&& !is_super_admin() ) {272 if ( $id == $current_user->ID && !is_super_admin() ) { 273 273 echo "<li>" . sprintf(__('ID #%1s: %2s <strong>The current user will not be removed.</strong>'), $id, $user->user_login) . "</li>\n"; 274 274 } elseif ( !current_user_can('remove_user', $id) ) { 275 275 echo "<li>" . sprintf(__('ID #%1s: %2s <strong>You don\'t have permission to remove this user.</strong>'), $id, $user->user_login) . "</li>\n"; -
wp-admin/includes/deprecated.php
255 255 256 256 if ( ! $user->has_cap($post_type_obj->cap->edit_others_posts) ) { 257 257 if ( $user->has_cap($post_type_obj->cap->edit_posts) || ! $exclude_zeros ) 258 return array($user-> id);258 return array($user->ID); 259 259 else 260 260 return array(); 261 261 } -
wp-admin/includes/ms.php
250 250 if ( ! is_object($errors) ) 251 251 $errors = new WP_Error(); 252 252 253 if ( $current_user-> id!= $_POST['user_id'] )253 if ( $current_user->ID != $_POST['user_id'] ) 254 254 return false; 255 255 256 256 if ( $current_user->user_email != $_POST['email'] ) { -
wp-admin/my-sites.php
17 17 18 18 $action = isset( $_POST['action'] ) ? $_POST['action'] : 'splash'; 19 19 20 $blogs = get_blogs_of_user( $current_user-> id);20 $blogs = get_blogs_of_user( $current_user->ID ); 21 21 22 22 if ( empty( $blogs ) ) 23 23 wp_die( __( 'You must be a member of at least one site to use this page.' ) ); … … 28 28 29 29 $blog = get_blog_details( (int) $_POST['primary_blog'] ); 30 30 if ( $blog && isset( $blog->domain ) ) { 31 update_user_option( $current_user-> id, 'primary_blog', (int) $_POST['primary_blog'], true );31 update_user_option( $current_user->ID, 'primary_blog', (int) $_POST['primary_blog'], true ); 32 32 $updated = true; 33 33 } else { 34 34 wp_die( __( 'The primary site you chose does not exist.' ) );