Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/08/2011 01:14:31 AM (15 years ago)
Author:
johnjamesjacoby
Message:

Use bp_displayed_user_id() rather than reference the $bp->displayed_user->id global var directly. First step at consolidating user ID checks to use WP_User class later. See #3738.

File:
1 edited

Legend:

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

    r4934 r5301  
    4242
    4343                // if running from ajax.
    44                 if ( !$bp->displayed_user->id )
     44                if ( !bp_displayed_user_id() )
    4545                        $bp->displayed_user->id = $creds['current_userid'];
    4646
    4747                if ( $this->populate_friend_details ) {
    48                         if ( $this->friend_user_id == $bp->displayed_user->id ) {
     48                        if ( $this->friend_user_id == bp_displayed_user_id() ) {
    4949                                $this->friend = new BP_Core_User( $this->initiator_user_id );
    5050                        } else {
     
    127127
    128128                if ( !$user_id )
    129                         $user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
     129                        $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : $bp->loggedin_user->id;
    130130
    131131                /* This is stored in 'total_friend_count' usermeta.
Note: See TracChangeset for help on using the changeset viewer.