Today I needed to change three things in a BuddyPress installation:
- Change the title of “Groups” to “My Conversations” in the BuddyPress component menu.
- Remove the “Forums” menu item from the BuddyPress component menu.
- 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!)
3 Comments
More posts from themightymo.com
How to optimize your Google Crawl Budget using SEM Rush Log File Analyzer and Rank Math SEO
Today I ran the SEM Rush Log File Analyzer tool, and it showed some interesting things that are a complete waste of our Google Crawl Budget. Specifically, I learned that Google is wasting some of our crawl budget on the /wp-includes/ directory, certain plugin directories, and cache directories. I also noticed random files being crawled…
Where is the Google Analytics Measurement ID?
In the vast, evolving world of web development and analytics, keeping up with terminologies and tools can sometimes feel like trying to chase a mischievous cat in a maze. You think you’ve got a grip, only for it to slip right through your fingers! Enter the mysterious “Measurement ID” from Google Analytics 4 (GA4), a…
How to Convert .aiff to .mp3 files via Command Line
Yesterday I ran into an issue where I needed to convert .aiff files to .mp3. DBPowerAmp was recommended to me as a paid GUI tool. But I wanted something more lightweight, since this is a task I rarely need to do (most of the time, I’m already in Logic Pro, and exporting is simple there).…
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
I don’t know… Let me know if you solve the problem, so I can post the solution here.
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 !