Changeset 1238 for trunk/bp-core/bp-core-templatetags.php
- Timestamp:
- 03/19/2009 01:35:32 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-templatetags.php
r1232 r1238 232 232 function bp_fetch_user_fullname( $user_id = false, $echo = true ) { 233 233 global $bp; 234 234 235 235 if ( !$user_id ) 236 236 $user_id = $bp->displayed_user->id; 237 238 if ( function_exists('xprofile_install') ) { 239 $data = xprofile_get_field_data( BP_XPROFILE_FULLNAME_FIELD_NAME, $user_id ); 240 241 if ( empty($data) ) { 237 238 if ( !$fullname = wp_cache_get( 'bp_user_fullname_' . $user_id, 'bp' ) ) { 239 if ( function_exists('xprofile_install') ) { 240 $fullname = bp_core_ucfirst( xprofile_get_field_data( BP_XPROFILE_FULLNAME_FIELD_NAME, $user_id ) ); 241 242 if ( empty($fullname) ) { 243 $ud = get_userdata($user_id); 244 $fullname = bp_core_ucfirst($ud->user_login); 245 246 xprofile_set_field_data( BP_XPROFILE_FULLNAME_FIELD_NAME, $user_id, $data ); 247 } 248 } else { 242 249 $ud = get_userdata($user_id); 243 $data = bp_core_ucfirst($ud->user_login); 244 245 xprofile_set_field_data( BP_XPROFILE_FULLNAME_FIELD_NAME, $user_id, $data ); 246 } else { 247 $data = bp_core_ucfirst($data); 250 $fullname = $ud->user_login; 248 251 } 249 } else { 250 $ud = get_userdata($user_id); 251 $data = $ud->user_login; 252 253 wp_cache_set( 'bp_user_fullname_' . $user_id, $fullname, 'bp' ); 252 254 } 253 255 254 256 if ( $echo ) 255 echo apply_filters( 'bp_fetch_user_fullname', stripslashes( trim( $ data) ) );257 echo apply_filters( 'bp_fetch_user_fullname', stripslashes( trim( $fullname ) ) ); 256 258 else 257 return apply_filters( 'bp_fetch_user_fullname', stripslashes ( trim ( $ data) ) );259 return apply_filters( 'bp_fetch_user_fullname', stripslashes ( trim ( $fullname ) ) ); 258 260 } 259 261
Note: See TracChangeset
for help on using the changeset viewer.