public
Last active

add subnav link to profile -> friends

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
 
add_action( 'bp_setup_nav', 'add_videos_subnav_tab', 100 );
 
function add_videos_subnav_tab() {
global $bp;
 
bp_core_new_subnav_item( array(
'name' => 'Videos',
'slug' => 'videos',
'parent_url' => trailingslashit( bp_loggedin_user_domain() . 'friends' ),
'parent_slug' => 'friends',
'screen_function' => 'profile_screen_video',
'position' => 50
)
);
}
 
// redirect to videos page when 'Videos' tab is clicked
// assumes that the slug for your Videos page is 'videos'
function profile_screen_video() {
bp_core_redirect( get_option('siteurl') . "/videos/" );
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.