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

bp_core_modify_admin_menu_highlight(); 

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


Usage

  1. if ( !function_exists( 'bp_core_modify_admin_menu_highlight' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/admin/bp-core-admin-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_core_modify_admin_menu_highlight(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bp-core/admin/bp-core-admin-functions.php  
  1. function bp_core_modify_admin_menu_highlight() { 
  2. global $plugin_page, $submenu_file; 
  3.  
  4. // This tweaks the Settings subnav menu to show only one BuddyPress menu item. 
  5. if ( ! in_array( $plugin_page, array( 'bp-activity', 'bp-general-settings', ) ) ) { 
  6. $submenu_file = 'bp-components'; 
  7.  
  8. // Network Admin > Tools. 
  9. if ( in_array( $plugin_page, array( 'bp-tools', 'available-tools' ) ) ) { 
  10. $submenu_file = $plugin_page;