BuddyPress comes with all the profile and group pages you need to access your settings and main content. Sometimes you add a plugin to your site that isn’t a BuddyPress plugin, but you want to have a profile page to display that extra content. If you’re a plugin developer, you can add BuddyPress support using this same technique. Adding custom BuddyPress pages to profiles doesn’t have to be complicated!
Let’s say you have a portfolio plugin and you want to put a tab/page on a user profile and include the portfolio items. If your portfolio items are a custom post type, you can add a post loop on the page and pass a query to the displayed BuddyPress user .
The following image is what we will accomplish in this tutorial:
Sometimes you add a plugin to your site that is not a BuddyPress plugin, but you want to have a profile page to display that extra content.
Profile tabs are created by passing an array or arguments to bp_core_new_nav_item()
<tab>. You can specify the name of the tab, the slug when visiting this page, the position relative to other tabs, css id, and the callback function that is executed when a user visits this URL. The position is the positioning in the user’s navigation. Navigation items are positioned in increments of ten. We passed fifty and this would be in the 5th position. If you wanted an item between 5 and 6, you could pass 51-59. The argument 'show_for_displayed_user'
is for a profile tab that you only want a logged in user to see on their profile.