Tagged: buddyboss group, buddypress group, my groups, user groups
Hi there, thanks for this forum I learned a lot of BuddyPress customizations.
Is there a way to hide a specific group in my profile group tab?
For example, if the group type is SECRET
The groups under SECRET group type will hide in my profile group tab.
I’m on this code but I don’t know what to do next…
$group_args = array(
‘group_type’ => array( ‘secret’, ‘secret2’ ),
);if ( bp_has_groups( $group_args ) && current_user_can(‘subscriber’) ) {
}
Hello Simon,
Thank you for asking. Please try the following code:
add_filter( 'bp_after_has_groups_parse_args', function ( $r ) { // Not show secret groups to other users except user on his own profile. if ( bp_is_user() && ! bp_is_my_profile() ) { $r['group_type__not_in'] = array( 'secret' ); } return $r; } );
Regards
RaviThanks for the response Ravi, unfortunately the code won’t work.
As of now my current setting of this secret group is in privacy hidden with the group type of secret. Also I’m using the buddyboss pro plugin
Is it possible to hide this secret group from the members, not for super admin and organizers? Sorry for asking too much =(
Hello Simon,
As you said the privacy of secret groups is hidden and hidden groups by default are invisible to non-members. These group names and descriptions are not listed in sitewide directories, and their contents are accessible only to members of the group. Because the group is unlisted, users cannot request membership. Instead, individuals can only join the group by invitation.
what are the organizers you are referring to is it group administrator?.
Please help me to understand your requirement so that I can help You.
Regards
RaviHi Ravi, sorry for the confusion.
So here is my scenario.
I have a group type called SECRET is there a way to hide the groups under the group type of secret? Even if the members are already joined the reason to hide these groups are solely for group messaging purposes only.
Hoping this can help you understand the scenario.
Thanks in advance
Hello Simon,
Thank you for the clarification. Can you provide me screenshots because it will give a more clear view of your requirements ?. As per my understanding, you are looking for a way to hide secret groups under Group’s directory > Secret Tab. Or point me you the link where these groups are rendering and you want to hide them.
Regards
RaviHi Ravi thanks for the reply please check the screenshot
https://prnt.sc/1sxxstmSomehow, I want to hide the group under secret group type in my profile -> group tab.
Thank you!
Hello Simon
Thank you for sharing the screenshot. Try the following code:
add_filter( 'bp_after_has_groups_parse_args', function ( $r ) { // Not show secret groups. if ( bp_is_user() && bp_is_current_action( 'my-groups' ) ) { $r['group_type__not_in'] = array( 'secret' ); } return $r; } );
Regards
Ravi
You must be logged in to reply to this topic.