Skip to:

Limiting # of subgroups

  • tracilynnb73


    Is there a way to have a limited # of subgroups in a hierarchy?

    So for example, if the site admin want to create a max of 3 subgroups, they would create the following hierarchy:
    (Parent) Country -> (Subgroup) State -> (Subgroup) City

    Then members are only able to create ONE additional subgroup below the City.

    Is this at all possible? If so what would I need to change in the code?


Viewing 1 replies (of 1 total)
  • No code change is necessary, although you will need to put some code in your functions.php file, or create another plugin to handle the limits.

    You can hook the `bp_group_hierarchy_available_parent_groups` filter, and remove groups that aren’t in the top 3 levels.

    You can find groups in the top 3 levels with the `bp_group_hierarchy_get_parents()` function.

    See this page for all the available functions and filters:

Viewing 1 replies (of 1 total)
  • The topic ‘Limiting # of subgroups’ is closed to new replies.
Skip to toolbar