Changeset 20378
- Timestamp:
- 04/06/2012 07:18:45 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/ajax-actions.php
r20332 r20378 743 743 744 744 $user = wp_get_current_user(); 745 if ( $user-> ID) {745 if ( $user->exists() ) { 746 746 $user_ID = $user->ID; 747 747 $comment_author = $wpdb->escape($user->display_name); -
trunk/wp-comments-post.php
r19712 r20378 55 55 // If the user is logged in 56 56 $user = wp_get_current_user(); 57 if ( $user-> ID) {57 if ( $user->exists() ) { 58 58 if ( empty( $user->display_name ) ) 59 59 $user->display_name=$user->user_login; … … 74 74 $comment_type = ''; 75 75 76 if ( get_option('require_name_email') && !$user-> ID) {76 if ( get_option('require_name_email') && !$user->exists() ) { 77 77 if ( 6 > strlen($comment_author_email) || '' == $comment_author ) 78 78 wp_die( __('<strong>ERROR</strong>: please fill the required fields (name, email).') ); -
trunk/wp-includes/capabilities.php
r19712 r20378 597 597 598 598 $this->data->$key = $value; 599 } 600 601 /** 602 * Determine whether the user exists in the database. 603 * 604 * @since 3.4.0 605 * @access public 606 * 607 * @return bool True if user exists in the database, false if not. 608 */ 609 function exists() { 610 return ! empty( $this->ID ); 599 611 } 600 612 … … 1260 1272 $user = new WP_User( $user ); 1261 1273 1262 if ( ! $user || ! $user-> ID)1274 if ( ! $user || ! $user->exists() ) 1263 1275 return false; 1264 1276 … … 1357 1369 $user = wp_get_current_user(); 1358 1370 1359 if ( empty( $user->ID) )1371 if ( ! $user->exists() ) 1360 1372 return false; 1361 1373 -
trunk/wp-includes/comment-template.php
r19712 r20378 1518 1518 $commenter = wp_get_current_commenter(); 1519 1519 $user = wp_get_current_user(); 1520 $user_identity = ! empty( $user->ID) ? $user->display_name : '';1520 $user_identity = $user->exists() ? $user->display_name : ''; 1521 1521 1522 1522 $req = get_option( 'require_name_email' ); -
trunk/wp-includes/comment.php
r20287 r20378 580 580 */ 581 581 function wp_set_comment_cookies($comment, $user) { 582 if ( $user-> ID)582 if ( $user->exists() ) 583 583 return; 584 584 -
trunk/wp-includes/ms-deprecated.php
r19712 r20378 50 50 } else { 51 51 $user = get_user_by( 'login', $user_login ); 52 if ( empty( $user->ID) )52 if ( ! $user->exists() ) 53 53 return false; 54 54 $user_id = $user->ID; -
trunk/wp-includes/ms-functions.php
r20287 r20378 186 186 $user = new WP_User($user_id); 187 187 188 if ( empty( $user->ID) ) {188 if ( ! $user->exists() ) { 189 189 restore_current_blog(); 190 190 return new WP_Error('user_does_not_exist', __('That user does not exist.')); … … 248 248 // wp_revoke_user($user_id); 249 249 $user = new WP_User($user_id); 250 if ( empty( $user->ID) ) {250 if ( ! $user->exists() ) { 251 251 restore_current_blog(); 252 252 return new WP_Error('user_does_not_exist', __('That user does not exist.')); -
trunk/wp-includes/pluggable.php
r20135 r20378 710 710 $user = wp_get_current_user(); 711 711 712 if ( empty( $user->ID) )712 if ( ! $user->exists() ) 713 713 return false; 714 714 -
trunk/wp-includes/user.php
r20239 r20378 260 260 $user = new WP_User( $user ); 261 261 262 if ( ! isset( $user->ID) )262 if ( ! $user->exists() ) 263 263 return false; 264 264 … … 941 941 $user_level = (int) isset($user->user_level) ? $user->user_level : 0; 942 942 943 if ( 0 == $user->ID) {943 if ( ! $user->exists() ) { 944 944 $user_login = $user_email = $user_url = $user_pass_md5 = $user_identity = ''; 945 945 return;
Note: See TracChangeset
for help on using the changeset viewer.