Changeset 2335
- Timestamp:
- 01/18/2010 01:57:03 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/bp-core.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core.php
r2330 r2335 547 547 548 548 /* Cache the link */ 549 wp_cache_set( 'bp_user_domain_' . $user_id, $domain, 'bp' ); 549 if ( !empty( $domain ) ) 550 wp_cache_set( 'bp_user_domain_' . $user_id, $domain, 'bp' ); 550 551 } 551 552 … … 987 988 * @return str the username of the matched user. 988 989 */ 989 function bp_core_get_username( $u id, $user_nicename = false, $user_login = false ) {990 global $bp; 991 992 if ( !$username = wp_cache_get( 'bp_user_username_' . $u id, 'bp' ) ) {990 function bp_core_get_username( $user_id, $user_nicename = false, $user_login = false ) { 991 global $bp; 992 993 if ( !$username = wp_cache_get( 'bp_user_username_' . $user_id, 'bp' ) ) { 993 994 if ( empty( $user_nicename ) && empty( $user_login ) ) { 994 995 $ud = false; 995 996 996 if ( $bp->loggedin_user->id == $u id )997 if ( $bp->loggedin_user->id == $user_id ) 997 998 $ud = &$bp->loggedin_user->userdata; 998 999 999 if ( $bp->displayed_user->id == $u id )1000 if ( $bp->displayed_user->id == $user_id ) 1000 1001 $ud = &$bp->displayed_user->userdata; 1001 1002 1002 1003 if ( empty( $ud ) ) { 1003 if ( !$ud = bp_core_get_core_userdata( $uid) )1004 if ( !$ud = bp_core_get_core_userdata( $user_id ) ) 1004 1005 return false; 1005 1006 $user_nicename = $ud->user_nicename;1007 $user_login = $ud->user_login;1008 1006 } 1007 1008 $user_nicename = $ud->user_nicename; 1009 $user_login = $ud->user_login; 1009 1010 } 1010 1011 … … 1016 1017 1017 1018 /* Add this to cache */ 1018 wp_cache_set( 'bp_user_username_' . $uid, 'bp' ); 1019 if ( !empty( $username ) ) 1020 wp_cache_set( 'bp_user_username_' . $user_id, $username, 'bp' ); 1019 1021 1020 1022 return apply_filters( 'bp_core_get_username', $username ); … … 1034 1036 function bp_core_get_user_email( $uid ) { 1035 1037 if ( !$email = wp_cache_get( 'bp_user_email_' . $uid, 'bp' ) ) { 1036 $ud = get_userdata($uid);1038 $ud = bp_core_get_core_userdata($uid); 1037 1039 $email = $ud->user_email; 1038 1040 } … … 1066 1068 */ 1067 1069 function bp_core_get_userlink( $user_id, $no_anchor = false, $just_link = false, $deprecated = false, $with_s = false ) { 1068 1069 1070 $display_name = bp_core_get_user_displayname( $user_id ); 1070 1071 … … 1110 1111 1111 1112 if ( empty($fullname) ) { 1112 $ud = get_userdata( $user_id );1113 $ud = bp_core_get_core_userdata( $user_id ); 1113 1114 1114 1115 if ( !empty( $ud->display_name ) ) … … 1120 1121 } 1121 1122 } else { 1122 $ud = get_userdata($user_id);1123 $ud = bp_core_get_core_userdata($user_id); 1123 1124 1124 1125 if ( !empty( $ud->display_name ) ) … … 1128 1129 } 1129 1130 1130 wp_cache_set( 'bp_user_fullname_' . $user_id, $fullname, 'bp' ); 1131 if ( !empty( $fullname ) ) 1132 wp_cache_set( 'bp_user_fullname_' . $user_id, $fullname, 'bp' ); 1131 1133 } 1132 1134
Note: See TracChangeset
for help on using the changeset viewer.