Last active
August 29, 2015 14:17
-
-
Save danbp/d474da401c462e30c93e to your computer and use it in GitHub Desktop.
BuddyPress - add a sub_nav item to profile tab
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
function bpfr_custom_profile_sub_nav() { | |
global $bp; | |
$parent_slug = 'profile'; | |
//Add subnav item | |
bp_core_new_subnav_item( array( | |
'name' => __( 'Create a Group', 'buddypress' ), | |
'slug' => $parent_slug, | |
'parent_url' => $bp->loggedin_user->domain . $parent_slug.'/', | |
'parent_slug' => $parent_slug, | |
'screen_function' => 'groups_screen_my_groups', | |
'position' => 60, | |
'link' => trailingslashit( bp_get_root_domain() ) . trailingslashit( bp_get_groups_root_slug() ) . trailingslashit( 'create' ), | |
) ); | |
} | |
add_action( 'bp_setup_nav', 'bpfr_custom_profile_sub_nav' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment