bp_core_new_nav_default()

bp_core_new_nav_default()

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

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注