Skip to content

Instantly share code, notes, and snippets.

@shanebp
Last active May 20, 2021 08:48
Show Gist options
  • Save shanebp/5561044 to your computer and use it in GitHub Desktop.
Save shanebp/5561044 to your computer and use it in GitHub Desktop.
add subnav link to profile -> friends
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/" );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment