Support » Plugin: BP Group Hierarchy » [Plugin: BP Group Hierarchy] Different tabs on parent groups?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author David Dean

    (@ddean)

    Hi Barry,

    Check out BuddyPress’s function bp_get_options_nav() for insight on how the tabs are built. There’s a filter in that function you can hook to hide certain tabs.

    For the other part, BP Group Hierarchy includes some functions you can use to tell where a group is in the hierarchy. In this case, you may just want to use bp_group_hierarchy_has_parent() which will return false for top-level groups.

    Hope that helps!

    – David

    Thanks David,

    Do you know if the filter for bp_get_options_nav works with tabs created by 3rd party plugins?

    Plugin Author David Dean

    (@ddean)

    From what I can tell, it will call filters for all tabs that are displayed even if they’re 3rd party.

    I have a similar goal, and here is the function that works (as of BP 1.6) to remove a tab (in this case the activity tab):
    $bp->bp_options_nav[$bp->groups->current_group->slug][‘activity’] = false;

    What I can’t seem to manage is how the conditional calling code should look or even where it should be in this case. The simplest approach would be to obviously throw it in bp-custom.php like usual, which I’ve tried, using the following code:

    if ( bp_group_hierarchy_has_parent()) {

    $bp->bp_options_nav[$bp->groups->current_group->slug][‘members’] = false;

    }

    But naturally it fails to undefined function error. I’ve tried to include the hierarchy class file, and setup a new handler for the class, but that fails to a ‘cannot redeclare class’.

    What’s the easiest way to access that function from bp-custom.php?

    Hey David, thank you for your responses. Dpeek, what action are you using to hook into?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: BP Group Hierarchy] Different tabs on parent groups?’ is closed to new replies.