Thank you wolfpup64,
there was a wrong variable name, i just updated, please use the updated code.
Oh sorry man, I realized I actually screwed up. Because I'm trying to link from a user's BuddyPress profile to the same user's wpForo page, I actually need a way to link from the currently displayed user's page. I'm a total noob at this stuff. I managed to create the tab by bogarting some code from some other support page, however the link is directed by a slug and if I remove the slug the whole tab disappears. It took me a while to find something that worked. Heres the code I'm using, located in mu-plugin:
function add_communityprofile_tab() {
global $bp;
bp_core_new_nav_item( array(
'name' => 'Community',
'slug' => 'communityprofile',
'parent_url' => $bp->displayed_user->domain,
'parent_slug' => $bp->profile->slug,
'screen_function' => 'communityprofile_screen',
'position' => 200,
'default_subnav_slug' => 'communityprofile'
add_action( 'bp_setup_nav', 'add_communityprofile_tab', 100 );
and I tried using this bit to link up to the wpForo page:
function communityprofile_screen() {
bp_core_redirect( site_url( '/community/profile/'.bp_displayed_user_username() ) );
But it just links up to the wpForo main site page.
The url of the BuddyPress profile pages is:
http://localhost/wordpress/users/*username*/profile/
What I'm trying to link up to is:
http://localhost/wordpress/community/profile/*username*
ah, somebody on the BuddyPress forum figured it out for me...now i just have to get it in the right place.