1. Create a new buddy press profile tab
  2. Create a new Tab on the BuddyPress profile page
  3. Adding a custom tab in BuddyPress Profile Page
  4. How to add another tab on the BuddyPress profile page.

Another BuddyPress tutorial which is part of continuing BuddyPress tutorial series. This article demonstrates a step-by-step guide on how to add another tab on the BuddyPress profile page.

If you are looking for a tutorial on how to create a new custom tab on the BuddyPress profile page, then you are in the right place.

Adding a Custom Tab in BuddyPress Profile Page

To add a new tab in profile BuddyPress profile page, we shall use the bp_core_new_nav_item() function as shown in the snippet code below.

add_action( 'bp_setup_nav', 'hacksmile_profile_tab_dinos' );
function hacksmile_profile_tab_dinos() {
  global $bp;
  bp_core_new_nav_item( array( 
    'name' => __( 'Dinos' ), 
    'slug' => 'dinos', 
    'screen_function' => 'hacksmile_dinos_screen', 
    'position' => 0
  ));
}

  function hacksmile_dinos_screen() {
    //add title and content here – last is to call the members plugin.php template
    add_action( 'bp_template_title', 'hacksmile_dinos_title' );
    add_action( 'bp_template_content', 'hacksmile_dinos_content' );
    bp_core_load_template( 'buddypress/members/single/plugins' );
  }

function hacksmile_dinos_title() {
    echo 'Title';
}

function hacksmile_dinos_content() {
    echo "content"; 
}

 

 

 

Similar Posts