Skip to:
Content

BuddyPress.org

Changeset 1723 for trunk/bp-core.php


Ignore:
Timestamp:
08/28/2009 07:05:23 PM (17 years ago)
Author:
apeatling
Message:

Fixing bug with inconsistent name display.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core.php

    r1721 r1723  
    163163        $bp->current_component = $bp->default_component;
    164164}
    165 add_action( 'plugins_loaded', 'bp_core_setup_globals', 3 );
    166 add_action( '_admin_menu', 'bp_core_setup_globals', 3 ); // must be _admin_menu hook.
     165add_action( 'plugins_loaded', 'bp_core_setup_globals', 5 );
     166add_action( '_admin_menu', 'bp_core_setup_globals', 2 ); // must be _admin_menu hook.
    167167
    168168
     
    879879    if ( !$fullname = wp_cache_get( 'bp_user_fullname_' . $user_id, 'bp' ) ) {
    880880        if ( function_exists('xprofile_install') ) {
    881             $fullname = xprofile_get_field_data( BP_XPROFILE_FULLNAME_FIELD_NAME, $user_id );
     881            $fullname = xprofile_get_field_data( 1, $user_id );
    882882
    883883            if ( empty($fullname) || !$fullname ) {
    884884                $ud = get_userdata($user_id);
    885885
    886                 if ( empty( $ud->display_name ) )
     886                if ( !empty( $ud->display_name ) )
     887                    $fullname = $ud->display_name;
     888                else
    887889                    $fullname = $ud->user_nicename;
    888                 else
    889                     $fullname = $ud->display_name;
    890 
    891                 xprofile_set_field_data( BP_XPROFILE_FULLNAME_FIELD_NAME, $user_id, $fullname );
     890
     891                xprofile_set_field_data( 1, $user_id, $fullname );
    892892            }
    893893        } else {
    894894            $ud = get_userdata($user_id);
    895             $fullname = $ud->display_name;
     895           
     896            if ( !empty( $ud->display_name ) )
     897                $fullname = $ud->display_name;
     898            else
     899                $fullname = $ud->user_nicename;
    896900        }
    897 
     901       
    898902        wp_cache_set( 'bp_user_fullname_' . $user_id, $fullname, 'bp' );
    899903    }
Note: See TracChangeset for help on using the changeset viewer.