Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/11/2012 03:21:00 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Replace direct references to $bp user fullname and user_login with their functional equivalents, and kill off some $bp global usage in the process. See #3994, #3989.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-friends/bp-friends-loader.php

    r5704 r5705  
    9191        global $bp;
    9292
     93        $sub_nav = array();
     94
    9395        // Add 'Friends' to the main navigation
    9496        $main_nav = array(
     
    146148
    147149            // Pending friend requests
    148             if ( $count = count( friends_get_friendship_request_user_ids( bp_loggedin_user_id() ) ) ) {
    149                 $title   = sprintf( __( 'Friends <span class="count">%s</span>',          'buddypress' ), $count );
    150                 $pending = sprintf( __( 'Pending Requests <span class="count">%s</span>', 'buddypress' ), $count );
     150            $count = count( friends_get_friendship_request_user_ids( bp_loggedin_user_id() ) );
     151            if ( !empty( $count ) ) {
     152                $title   = sprintf( __( 'Friends <span class="count">%s</span>',          'buddypress' ), number_format_i18n( $count ) );
     153                $pending = sprintf( __( 'Pending Requests <span class="count">%s</span>', 'buddypress' ), number_format_i18n( $count ) );
    151154            } else {
    152155                $title   = __( 'Friends',             'buddypress' );
     
    200203                    'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() )
    201204                ) );
    202                 $bp->bp_options_title  = $bp->displayed_user->fullname;
     205                $bp->bp_options_title = bp_get_displayed_user_fullname();
    203206            }
    204207        }
Note: See TracChangeset for help on using the changeset viewer.