Skip to:

Take away Create a Group option

  • Wardee


    How can I take away the Create a Group option — both in the BP nav bar and in the member pages? I am thinking of what lines in the code to comment out?

    I would like to take this capability away for all but the administrator(s), but I’d settle for just turning it off altogether if I can’t do it selectively.

    I have groups created and I don’t want any more created, at least not by members. My community has pre-defined groups.

    I feel it would be great to see a plugin for this, or the option coded into BP, down the road so that the code doesn’t have to be hacked each time a new version comes out.

Viewing 2 replies - 1 through 2 (of 2 total)

  • Burt Adsit


    Hi wardeh. I was checking the ‘topics with no replies’ and saw you here. All by your lonesome self. How goes the battle this week?

    You don’t want to turn off groups but you just don’t want the option to create more groups to be available. Well, you want group creation to be a site admin thing only. Hmmm…

    I went and looked at the member theme code and finally arrived in the core code and lo and behold Andy was thinking of you! There is an unused option for the menu items. ‘site admin’ only. You’ll have to modify one line to turn off the group creation option for everyone except you.

    In the file /mu-plugins/bp-groups.php at line 205. This currently reads:

    bp_core_add_subnav_item( $bp, 'create', __('Create a Group', 'buddypress'), $groups_link, 'groups_screen_create_group', false, bp_is_home() );

    Change that line to read:

    bp_core_add_subnav_item( $bp, 'create', __('Create a Group', 'buddypress'), $groups_link, 'groups_screen_create_group', false, bp_is_home(), true );

    That change adds the ‘true’ parameter at the end which normally defaults to ‘false’. It’s the ‘site admin only’ sees this menu item flag.

    Merry Christmas. :)



    Merry Christmas to you, Burt! This is awesome. Thank you so much. I have more questions to post but will wait for another day.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Take away Create a Group option’ is closed to new replies.
Skip to toolbar