Skip to:
Content
Pages
Categories
Search
Top
Bottom

Limiting # of subgroups

  • Avatar of tracilynnb73
    tracilynnb73
    Member

    @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?

    Thanks!

Viewing 1 replies (of 1 total)
  • Avatar of David Dean
    David Dean
    Participant

    @ddean

    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: http://www.generalthreat.com/projects/buddypress-group-hierarchy/

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.