Codex Home → Developer Resources → Function Examples → Core Component → bp_core_new_nav_default()
bp_core_new_nav_default()
This function changes the default subnav item of a parent item.
Example:
function change_settings_subnav() {
$args = array(
'parent_slug' => 'settings',
'screen_function' => 'bp_core_screen_notification_settings',
'subnav_slug' => 'notifications'
);
bp_core_new_nav_default($args);
}
add_action('bp_setup_nav', 'change_settings_subnav', 5);
This changes the default subnav of the 「Settings」 nav item to 「Notifications」
NOTE: The 5 priority flag is required
Source File
bp_core_new_nav_default() is located in bp-core/bp-core-buddybar.php