Hello again team!
I was looking for (couldn’t find it) a way to stop members to leaving certain groups.
Say I have an important group I want all my members to always be part of so I need to stop them from leaving that particular group. Is that possible?
Thank you again!
BrunoHi Bruno,
Thank you for the question.BuddyPress does not provide any way to achieve it. It is possible to do that by hacking around some code.
Which theme and template pack are you using? Please let me know and I will share the code.
Regards
BrajeshHello Bruno,
Please try the following code in your bp-custom file.
add_filter( 'bp_get_group_join_button', function ( $args, $group ) { // Replace with your group ids. $groups_with_disable_leave_btn = array( 5, 36 ); if ( ! empty( $group->is_member ) && ! empty( $group->id ) && in_array( $group->id, $groups_with_disable_leave_btn ) ) { $args = array(); } return $args; }, 10, 2 );
For more info: https://buddydev.com/docs/buddypress-guides/what-is-bp-custom-php/
Regards
Ravi
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.
This topic is: not resolved