Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/06/2017 03:46:07 PM (9 years ago)
Author:
djpaul
Message:

Groups: use class methods to check if user has visibility of a group.

Improves upon existing duplication of logic.

Fixes #7608

Props dcavins

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/bp-activity-screens.php

    r11698 r11761  
    231231        }
    232232
    233         // Check to see if the group is not public, if so, check the
    234         // user has access to see this activity.
     233        // Check to see if the user has access to to the activity's parent group.
    235234        if ( $group = groups_get_group( $activity->item_id ) ) {
    236 
    237             // Group is not public.
    238             if ( 'public' != $group->status ) {
    239 
    240                 // User is not a member of group.
    241                 if ( !groups_is_user_member( bp_loggedin_user_id(), $group->id ) ) {
    242                     $has_access = false;
    243                 }
    244             }
     235            $has_access = $group->user_has_access;
    245236        }
    246237    }
Note: See TracChangeset for help on using the changeset viewer.