I have one last bridge to cross.
This one is proving to be giving the biggest headache.
Can you tell me how I can hook into the following part of groups-templatetags so I can conditionally change the status of a group.
function bp_group_status() {
259 echo bp_get_group_status();
260 }
261 function bp_get_group_status( $group = false ) {
262 global $groups_template;
263
264 if ( !$group )
265 $group =& $groups_template->group;
266
267 return apply_filters( 'bp_get_group_status', $group->status );
268 }
269
I have tried to do the following
function ct_group_is_member( $group = false ) {
global $bp, $groups_template;
// Site admins always have access
if ( is_site_admin() )
return;
$current_user = $bp->loggedin_user->id;
$current_institution = get_usermeta($current_user,"institution");
// Load group if none passed
if ( !$group )
$group =& $groups_template->group;
// Check membership
if ( $current_institution<>groups_get_groupmeta($group->id,"institution" )) {
$group->status = 'hidden';
} else {
return;
}
// Return
// return apply_filters( 'ct_group_is_member', $is_institution );
}
add_filter ( 'bp_get_group_status', 'ct_group_is_member', 5, 2 );
Thanks HEAPS in advance
V