Skip to:
Content

BuddyPress.org

Changeset 1241


Ignore:
Timestamp:
03/19/2009 04:36:58 PM (16 years ago)
Author:
apeatling
Message:

Making fetch user fullname function return when $user_id is not set.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-templatetags.php

    r1238 r1241  
    230230}
    231231
    232 function bp_fetch_user_fullname( $user_id = false, $echo = true ) {
     232function bp_fetch_user_fullname( $user_id, $echo = true ) {
    233233    global $bp;
    234234   
    235235    if ( !$user_id )
    236         $user_id = $bp->displayed_user->id;
    237    
     236        return false;
     237       
    238238    if ( !$fullname = wp_cache_get( 'bp_user_fullname_' . $user_id, 'bp' ) ) {
    239239        if ( function_exists('xprofile_install') ) {
    240240            $fullname = bp_core_ucfirst( xprofile_get_field_data( BP_XPROFILE_FULLNAME_FIELD_NAME, $user_id ) );
    241241
    242             if ( empty($fullname) ) {
     242            if ( empty($fullname) || !$fullname ) {
    243243                $ud = get_userdata($user_id);
    244244                $fullname = bp_core_ucfirst($ud->user_login);
Note: See TracChangeset for help on using the changeset viewer.