Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save toluaddy/99593630de94130cbf1e6e84a3c3d92d to your computer and use it in GitHub Desktop.
Save toluaddy/99593630de94130cbf1e6e84a3c3d92d to your computer and use it in GitHub Desktop.
Changing navigation names of BuddyPress
<?php
function mb_profile_menu_tabs() {
global $bp;
$bp->bp_nav['groups']['name'] = str_replace( 'Groups', '群', $bp->bp_nav['groups']['name'] );
$bp->bp_nav['friends']['name'] = str_replace( 'Friends', '好友', $bp->bp_nav['friends']['name'] );
$bp->bp_nav['messages']['name'] = str_replace( 'Messages', '信息', $bp->bp_nav['messages']['name'] );
$bp->bp_nav['notifications']['name'] = str_replace( 'Notifications', '通知', $bp->bp_nav['notifications']['name'] );
$bp->bp_nav['forums']['name'] = '论坛';
}
add_action( 'bp_setup_nav', 'mb_profile_menu_tabs', 10 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment