Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/08/2011 01:14:31 AM (13 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-themes/bp-default/_inc/ajax.php

    r5262 r5301  
    4040    if ( !empty( $_BP_COOKIE['bp-' . $object . '-scope'] ) ) {
    4141        if ( 'personal' == $_BP_COOKIE['bp-' . $object . '-scope'] ) {
    42             $user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
     42            $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : $bp->loggedin_user->id;
    4343            $qs[] = 'user_id=' . $user_id;
    4444        }
    45         if ( 'all' != $_BP_COOKIE['bp-' . $object . '-scope'] && empty( $bp->displayed_user->id ) && !$bp->is_single_item )
     45        if ( 'all' != $_BP_COOKIE['bp-' . $object . '-scope'] && !bp_displayed_user_id() && !$bp->is_single_item )
    4646            $qs[] = 'scope=' . $_BP_COOKIE['bp-' . $object . '-scope']; // Activity stream scope only on activity directory.
    4747    }
Note: See TracChangeset for help on using the changeset viewer.