Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • As I have not managed to code something that works to identify my specific group, I did a bit of lateral thinking and my code looks to see whether or not a “group_mod” is present in a group and (if not) the Join/Hide button is hidden, like the case of group_admins, when only one is present. I can live with it for now, as I just have to make sure that all other groups have at least one Moderator set, then they work as normal.

    It works fine for me, using BuddyPress Version 10.4.0, under WordPress 6.0.2 and a modified “Wellness Pro Version: 1.1.4” child theme under Genesis Framework Version: 3.3.5.

    I hope it helps, unless and until some kind BuddyPress dev comes in with a proper solution!

    
    // SPECIAL G4WKW CODE
    // If NO group mods, STOP ANYONE abandoning that group. 
    $group_mods = groups_get_group_mods( $group->id );				
    $modsno = count( $group_mods );
    if ( $modsno < 1 ) {
    	return false;
    }
    

    Seems I wrote too much? I will post in two parts:

    Hi @hcmendez, I am trying to do exactly the same thing myself and found the post your referenced, which was now made 10 years ago! I have developed a staging test site for a Radio Club, where registration is disabled and all user accounts will be set up for the users. There are 3 levels of membership: member, editor and admin – each with separate user roles. I have a group called “ROC Members” which all levels of membership are in and I do not want them to have the ability to leave (so want to remove the Join/Leave Button from this group (I can manage members from WP backend).

    After some experimentation, I have found a rather poor “workaround”, by adding an extra ‘if’ statement to the code in plugins -> buddypress -> bp-groups -> bp-groups-template.php (where the extra code above is from), which is far from ideal as it can get overwritten on buddypress update.

Viewing 3 replies - 1 through 3 (of 3 total)
Skip to toolbar