Tagged: Group Members
Hi Brajesh,
Just following an earlier thread (https://buddydev.com/support/forums/topic/hide-members-directory-in-groups/), I don’t want to hide the members tab – I would only like to hide the Members in the list. So that only the group admin and moderators are visible. Would it be possible?
Would really appreciate if you could kindly help.
Kind regards,
JamesHi James,
Thank you for the question.I am asking one of my colleagues to look into it and assist you with the code.
Regards
BrajeshThanks Brajesh, really appreciate.
Kind regards,
JamesHello James,
Please try the following code. It will list only group admin and moderators under members tab.
/** * List only group admins and moderators only under members tab * * @param array $r Parameters for group members. * * @return mixed */ function buddydev_list_group_admins_moderators_only( $r ) { $r['exclude_admins_mods'] = 0; $r['group_role'] = array( 'admin', 'mod' ); return $r; } add_filter( 'bp_after_group_has_members_parse_args', 'buddydev_list_group_admins_moderators_only' );
Regards
RaviHi Ravi,
Thank you so much, it lists only the group admin under the members tab – which is great. But it hides the members from Group Admin and the Site Administrator as well.
We wanted the Group Admin and Site Administrator to be able to see the Members in the Group. So all members should be hidden from each other (except from Group Admin and Site Admin).
Best regards,
JamesHello James,
Please remove above mentioned code and use the following code
/** * List only group admins and moderators only under members tab * * @param array $r Parameters for group members. * * @return mixed */ function buddydev_list_group_admins_moderators_only( $r ) { if ( is_super_admin() || groups_is_user_admin( bp_loggedin_user_id(), bp_get_current_group_id() ) ) { return $r; } $r['exclude_admins_mods'] = 0; $r['group_role'] = array( 'admin', 'mod' ); return $r; } add_filter( 'bp_after_group_has_members_parse_args', 'buddydev_list_group_admins_moderators_only' );
Regards
RaviHi Ravi,
Many thanks, worked perfectly.
All the team at BuddyDev are just amazing, extremely helpful.
Best regards,
James
The topic ‘ [Resolved] Hide Members List in Groups’ is closed to new replies.