Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Basically if you see the picture below there are 5 tab items in my groups page:

Screenshot

Now, I want to be able to remove some of them. I want to be able to remove "Members" and "Send Invites" (for instance).

This is on the frontend groups page. When you select a group and go to view it.

I don't want to edit core files really, is there any other way to do this? Maybe a remove_action?

Thank you.

share|improve this question
add comment

2 Answers

The answer above does not work in 1.5

$bp->groups->slug

needs to become

bp_get_current_group_slug()

To support both version of bp use:

function remove_group_options()
{
    global $bp;
    $parent_slug = isset( $bp->bp_options_nav[$bp->groups->current_group->slug] ) ? $bp->groups->current_group->slug : $bp->groups->slug;
    bp_core_remove_nav_item( $parent_slug, 'members' );
    bp_core_remove_nav_item( $parent_slug, 'send-invites' );
}
add_action( 'bp_setup_nav', 'remove_group_options' );
share|improve this answer
    
this causes page not found errors for me in BP 1.6.2 –  Zade Feb 13 '13 at 11:43
add comment
up vote 3 down vote accepted

Managed to crawl through the core code and find this function:

bp_core_remove_subnav_item

So you can do something like this:

function remove_group_options() {
    global $bp;

    bp_core_remove_subnav_item($bp->groups->slug, 'members');
    bp_core_remove_subnav_item($bp->groups->slug, 'send-invites');

}
add_action( 'bp_setup_nav', 'remove_group_options' );
share|improve this answer
    
this has no effect for me in BP 1.6.2 –  Zade Feb 13 '13 at 11:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.