Skip to content

Instantly share code, notes, and snippets.

@KaineLabs
Created October 18, 2018 06:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KaineLabs/c0639aa2d5ad09f8f46a476ba96b7e77 to your computer and use it in GitHub Desktop.
Save KaineLabs/c0639aa2d5ad09f8f46a476ba96b7e77 to your computer and use it in GitHub Desktop.
Remove "Leave Group" For Private Groups.
<?php
/**
* Remove "Leave Group" For Private Groups.
*/
function yzc_remove_leave_group_button_for_private_groups( $button, $group ) {
if ( 'leave_group' == $button['id'] ) {
$group_type = bp_get_group_status( $group );
if ( $group_type == 'private' ) {
return '';
}
}
return $button;
}
add_filter( 'bp_get_group_join_button', 'bp_remove_group_join_button', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment