Last active
May 20, 2021 08:48
-
-
Save shanebp/5561044 to your computer and use it in GitHub Desktop.
add subnav link to profile -> friends
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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