Skip to:
Content
Pages
Categories
Search
Top
Bottom

Coding question

  • @nlvp

    Member

    Hope this is in the right place…

    I’m trying to figure out how I would go about coding an extension/plugin that, among other things, installs new tab to the user profile (alongside Activity, Profile, Messages, Friends, etc). So I need to add an entry to $bp->bp_nav and then I need to add the relevant information in the right places to tell the system what to put in that new tab.

    I’ve found bp_core_new_nav_item(), but I’m not sure this is the function that adds menu options to the profile page or more generally to the user menu. Also, once set up, how do I get the menu option to display the relevant information in the following page?

    If there a plugin that does this well that I can learn from and that you can point me to?

    Many thanks…

Viewing 2 replies - 1 through 2 (of 2 total)
  • @boonebgorges

    Keymaster

    What you’re essentially doing is adding a new component. See https://wordpress.org/extend/plugins/buddypress-skeleton-component/ for some inspiration. Or, for something a little simpler, see how BP itself does it. Look in bp-friends.php for an easy example. The key functions are: friends_setup_globals(), friends_setup_nav(), and the screen functions referred to in friends_setup_nav(). Copy those to your own plugin file, change the function names (so you don’t get fatal errors) and then play around.

    @nlvp

    Member

    Thanks for the pointers.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Coding question’ is closed to new replies.
Skip to toolbar