Re: How to I add something to “item-nav” on Profile Page?
Are you talking about adding it to the nav? Here’s some code I use (which I think I took from Boone’s plugin):
function process_donations_setup_profile_nav() {
global $bp;
/* Add ‘Donations’ tab to the main user profile navigation */
bp_core_new_nav_item( array(
‘name’ => __( ‘Donations’, ‘buddypress’ ),
‘slug’ => $bp->process_donations->slug,
‘position’ => 25,
‘screen_function’ => ‘process_donations_donations_collected’,
‘default_subnav_slug’ => ‘donations-collected’,
‘show_for_displayed_user’ => process_donations_access_test()
) );
$process_donations_link = $bp->loggedin_user->domain . $bp->process_donations->slug . ‘/’;
/* Create two sub nav items for this component */
bp_core_new_subnav_item( array(
‘name’ => __( ‘Donations Collected’, ‘bp-invite-anyone’ ),
‘slug’ => ‘donations-collected’,
‘parent_slug’ => $bp->process_donations->slug,
‘parent_url’ => $process_donations_link,
‘screen_function’ => ‘process_donations_donations_collected’,
‘position’ => 10,
‘user_has_access’ => process_donations_access_test()
) );
bp_core_new_subnav_item( array(
‘name’ => __( ‘Donations Made’, ‘bp-invite-anyone’ ),
‘slug’ => ‘donations-made’,
‘parent_slug’ => $bp->process_donations->slug,
‘parent_url’ => $process_donations_link,
‘screen_function’ => ‘process_donations_donations_made’,
‘position’ => 20,
‘user_has_access’ => process_donations_access_test()
) );
}
add_action( ‘wp’, ‘process_donations_setup_profile_nav’, 2 );
add_action( ‘admin_menu’, ‘process_donations_setup_profile_nav’, 2 );