Skip to content

Instantly share code, notes, and snippets.

@danbp
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danbp/d474da401c462e30c93e to your computer and use it in GitHub Desktop.
Save danbp/d474da401c462e30c93e to your computer and use it in GitHub Desktop.
BuddyPress - add a sub_nav item to profile tab
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