bp_core_modify_admin_menu_highlight()

This tells WP to highlight the Settings > BuddyPress menu item, regardless of which actual BuddyPress admin screen we are on.

Description

The conditional prevents the behaviour when the user is viewing the backpat "Help" page, the Activity page, or any third-party plugins.

Source

File: bp-core/admin/bp-core-admin-functions.php

function bp_core_modify_admin_menu_highlight() {
	global $plugin_page, $submenu_file;

	// This tweaks the Settings subnav menu to show only one BuddyPress menu item.
	if ( ! in_array( $plugin_page, array( 'bp-activity', 'bp-general-settings', ) ) ) {
		$submenu_file = 'bp-components';
	}

	// Network Admin > Tools.
	if ( in_array( $plugin_page, array( 'bp-tools', 'available-tools' ) ) ) {
		$submenu_file = $plugin_page;
	}
}

Changelog

Changelog
Version Description
BuddyPress 1.6.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.