Create a custom menu tab in BuddyPress profiles for additional content.
// Add a custom menu item to BuddyPress profile navigation
function add_custom_menu_item() {
bp_core_new_subnav_item(array(
'name' => 'My Custom Tab',
'slug' => 'custom-tab',
'parent_url' => bp_displayed_user_domain() . '/profile/',
'parent_slug' => 'profile',
'screen_function' => 'custom_tab_content',
'position' => 50,
));
}
function custom_tab_content() {
echo '<h2>Custom Content</h2>';
echo '<p>This is a custom tab in the BuddyPress profile.</p>';
}
add_action('bp_setup_nav', 'add_custom_menu_item');