How to Add, Remove, and Change the Order Of BuddyPress Component Menu

Today I needed to change three things in a BuddyPress installation:

  1. Change the title of “Groups” to “My Conversations” in the BuddyPress component menu.
  2. Remove the “Forums” menu item from the BuddyPress component menu.
  3. Change the order of the BuddyPress component menu such that the “Messages” link is in a different place.

To accomplish these three things, I added the following to my theme’s functions.php file:

// Setup the navigation
// Props to http://wordpress.stackexchange.com/questions/16223/add-buddypress-profile-menu-item for helping me figure this out
// http://themekraft.com/customize-profile-and-group-menus-in-buddypress/
function my_setup_nav() {
      global $bp;
      // Change the order of menu items
      $bp->bp_nav['messages']['position'] = 100;
      // Remove a menu item
      $bp->bp_nav['conversations'] = false;
      // Change name of menu item
      $bp->bp_nav['communities']['name'] = 'My Conversations';
}
add_action( 'bp_setup_nav', 'my_setup_nav', 1000 );

Pretty nifty, eh?

By the way, if you want to see all of your options for editing the components menu, just throw the following into functions.php:

function bp_dump() {
    global $bp;
 
    foreach ( (array)$bp as $key => $value ) {
        echo '
'; echo '' . $key . ':
;'; print_r( $value ); echo '
'; } die; }

(Thanks ThemeKraft!)

Posted in ,

The Mighty Mo! Design Co.

3 Comments

  1. Rick Roberts on February 7, 2012 at 10:22 pm

    Thank you so much for posting this solution. It worked almost perfectly. There is a partial tab left over on the left side, and I can’t figure out where that is coming from. Picture here: http://d.pr/vqh4



    • toby on February 16, 2012 at 3:40 am

      I don’t know… Let me know if you solve the problem, so I can post the solution here.



  2. mecanographik on March 2, 2012 at 9:47 am

    Hey, i have a found a way to hide the partial tab with just a bit of css in your bp child theme stylesheet :

    div.item-list-tabs ul #-personal-li{display:none;}

    i’m sure there is a way to do it with a hook on the bp_get_displayed_user_nav function, but i couldn’t figure it out !



RSS From Toby’s Blog

  • “Now THAT was a good meeting!”
    A single effective meeting can change the course of history for a company. Imagine if you could lead effective meetings EVERY DAY! You can, but it takes curiosity & practice. This article is a good place to start your journey to a more effective you.
  • Never Respond to RFPs & Custom Proposal Requests
    Y'all who work at normal 9-5 jobs don't need to deal with the B.S. that is an RFP process (or rather you get paid to deal with it). But us freelancers gotta deal with a whole big bag of schtuff when it comes to custom proposals. Here's my quick-and-dirty RFP filtering process that I use […]
  • What content should I put on my homepage?
    I see websites as one stop of many on the sales journey, useful to help get customers from Point A to Point B in the sales process (or maybe from Point D to Point E).  If you are wondering about what to put on your homepage, start with these basic sales-related questions: Who, specifically, will…

More posts from themightymo.com

How to Connect a GoDaddy Site to ManageWP

By The Mighty Mo! Design Co. | June 27, 2022

GoDaddy owns ManageWP, and, strangely, they make it very difficult to add GoDaddy-managed WordPress sites to their ManageWP service. Thankfully, there’s a quick workaround: Visit https://yoursite.com/wp-admin/plugins.php?showWorker=1 — This will make the ManageWP “Worker” plugin visible. Copy the connection info from the ManageWP Worker plugin. Add the site per-normal on ManageWP. That’s it! I hope this…

How to check if your current page is the wp-login.php page

By The Mighty Mo! Design Co. | June 7, 2022

I realized this morning that my TMM Maintenance Mode WordPress plugin had a bug that was causing the wp-login.php page to be inaccessible. The solution was to write a simple function that checks whether or not we’re currently on a login page, and then add a call to that function in my code. Here’s the…

woocommerce logo

WooCommerce Product Image Gallery Not Loading with WP Rocket Active

By The Mighty Mo! Design Co. | June 6, 2022

Today I updated a WooCommerce site, and everything worked fine, except for the images on product pages – they were not displaying at all. After a lot of trial & error, I realized that WP Rocket was to blame. I’m not sure exactly what the issue was (though my hunch is that it had to…

RSS From Toby’s Blog

  • “Now THAT was a good meeting!”
    A single effective meeting can change the course of history for a company. Imagine if you could lead effective meetings EVERY DAY! You can, but it takes curiosity & practice. This article is a good place to start your journey to a more effective you.
  • Never Respond to RFPs & Custom Proposal Requests
    Y'all who work at normal 9-5 jobs don't need to deal with the B.S. that is an RFP process (or rather you get paid to deal with it). But us freelancers gotta deal with a whole big bag of schtuff when it comes to custom proposals. Here's my quick-and-dirty RFP filtering process that I use […]
  • What content should I put on my homepage?
    I see websites as one stop of many on the sales journey, useful to help get customers from Point A to Point B in the sales process (or maybe from Point D to Point E).  If you are wondering about what to put on your homepage, start with these basic sales-related questions: Who, specifically, will…