Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: bbp_has_topics – hide topics from private grou

@dcavins

Keymaster

You should be able to wrap your bbp_has_topics output in a conditional like:

if ( bp_group_is_visible() ) {
//do the topics loop here
}

bp_group_is_visible checks to see if the group is public or private, and if it’s public, returns true. If not public, then it checks to see if the user is a member of the current group; if yes, it returns true. It’s located at /bp-groups/bp-groups-template.php -> line 377.

function bp_group_is_visible( $group = false ) {
 378      global $groups_template;
 379  
 380      if ( bp_current_user_can( 'bp_moderate' ) )
 381          return true;
 382  
 383      if ( empty( $group ) )
 384          $group =& $groups_template->group;
 385  
 386      if ( 'public' == $group->status ) {
 387          return true;
 388      } else {
 389          if ( groups_is_user_member( bp_loggedin_user_id(), $group->id ) ) {
 390              return true;
 391          }
 392      }
 393  
 394      return false;
 395  }
Skip to toolbar