Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/08/2011 01:24:47 AM (13 years ago)
Author:
johnjamesjacoby
Message:

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

File:
1 edited

Legend:

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

    r5301 r5302  
    107107                bp_update_is_item_admin( true, 'groups' );
    108108            else
    109                 bp_update_is_item_admin( groups_is_user_admin( $bp->loggedin_user->id, $this->current_group->id ), 'groups' );
     109                bp_update_is_item_admin( groups_is_user_admin( bp_loggedin_user_id(), $this->current_group->id ), 'groups' );
    110110
    111111            // If the user is not an admin, check if they are a moderator
    112112            if ( !bp_is_item_admin() )
    113                 bp_update_is_item_mod  ( groups_is_user_mod  ( $bp->loggedin_user->id, $this->current_group->id ), 'groups' );
     113                bp_update_is_item_mod  ( groups_is_user_mod  ( bp_loggedin_user_id(), $this->current_group->id ), 'groups' );
    114114
    115115            // Is the logged in user a member of the group?
    116             if ( ( is_user_logged_in() && groups_is_user_member( $bp->loggedin_user->id, $this->current_group->id ) ) )
     116            if ( ( is_user_logged_in() && groups_is_user_member( bp_loggedin_user_id(), $this->current_group->id ) ) )
    117117                $this->current_group->is_user_member = true;
    118118            else
     
    314314                 !is_super_admin() &&
    315315                 !$this->current_group->is_user_member &&
    316                  !groups_check_for_membership_request( $bp->loggedin_user->id, $this->current_group->id ) &&
     316                 !groups_check_for_membership_request( bp_loggedin_user_id(), $this->current_group->id ) &&
    317317                 $this->current_group->status == 'private'
    318318                ) {
     
    393393
    394394            // Pending group invites
    395             $count = groups_get_invites_for_user( $bp->loggedin_user->id );
     395            $count = groups_get_invites_for_user( bp_loggedin_user_id() );
    396396
    397397            if ( !empty( $count->total ) ) {
Note: See TracChangeset for help on using the changeset viewer.