The admin bar links are generated in the component files, like bp-groups.php, bp-wire.php, etc. Here’s how you can set the text of these links without altering the core files.
function change_text(){
global $bp;
$bp->bp_nav[activity]['name'] = 'test'
}
add_action('wp', 'change_text');
This sets the text of the activity link to ‘test.’ If you just want to change the name of another link, use this same function and replace ‘activity’ with the slug of the component link you want to change.
To set other text in the nav, do a print_r on $bp->bp_nav, navigate the array and set your value. You can change link urls, position, and other things as well.
Remember, you have to add this code to a plugin or your custom.php.
Very handy to know. Thanks
Thank you dpolant, that’s what I was looking for.
Very handy code! I cannot seem to change the word ‘Blogs’ using this code though. I’ve tested it for ‘Activity’ and it works fine, but trying to use the following code just adds another list item to the navigation:
function change_text() {
global $bp;
$bp->bp_nav[blogs] = ‘test’;
}
add_action(‘wp’, ‘change_text’);