Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Extending Groups Navigation


techguy
Participant

@crashutah

I checked that out r-a-y. It looks like the bp_core_add_subnav_item is where I attach a screen function. However, it seems like the Group API might be doing this on its own already? Otherwise why would the nav appear there in the first place? Seems like when I do “class BP_Org_Info extends BP_Group_Extension {}” there’s something built in to add the nav and attach the screen function, but I can’t see where and how to change it so it links properly.

I did try like the skeleton component suggested and did the following which didn’t work for me. Maybe this is the way I have attach the screen function and I’m just calling it wrong? Here’s my code

function org_info_add_subnav() {
global $bp;
bp_core_add_subnav_item( array(
‘name’ => __(‘Organization Info’, ‘buddypress’),
‘slug’ => $bp->org_info->slug,
‘parent_slug’ => BP_GROUPS_SLUG,
‘parent_url’ => $bp->loggedin_user->domain . $bp->group->slug . ‘/’,
‘position’ => 30,
‘screen_function’ => ‘display’ //Should this be a call to some part of the Group API?
));
}
add_action( ‘wp’, ‘org_info_add_subnav’, 2 );

Maybe one of the options I’m passing into bp_core_add_subnav_item is wrong, but I also just noticed that I’m getting this in the error logs:
PHP Fatal error: Call to undefined function bp_core_add_subnav_item()

Do I have to include some other file to use bp_core_add_subnav_item()

Skip to toolbar