bb_get_current_admin_menu

The BuddyPress bb get current admin menu function.

Description

bb_get_current_admin_menu(); 

Usage

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

Defined (1)

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

/bp-forums/bbpress/bb-admin/includes/functions.bb-admin.php  
  1. function bb_get_current_admin_menu() 
  2. global $bb_menu, $bb_submenu, $bb_admin_page, $bb_current_menu, $bb_current_submenu; 
  3. foreach ( $bb_submenu as $m => $b ) { 
  4. foreach ( $b as $s ) { 
  5. if ( $s[2] == $bb_admin_page ) { 
  6. $bb_current_submenu = $s; 
  7. $bb_current_menu = $m; 
  8. break; 
  9. if ( !isset($bb_current_menu) ) { 
  10. $bb_current_menu = $bb_menu[0]; 
  11. $bb_current_submenu = $bb_submenu['index.php'][5]; 
  12. } else { 
  13. foreach ( $bb_menu as $m ) { 
  14. if ( $m[2] == $bb_current_menu ) { 
  15. $bb_current_menu = $m; 
  16. break; 
  17. if ( $bb_current_submenu && !bb_current_user_can( $bb_current_submenu[1] ) || !bb_current_user_can( $bb_current_menu[1] ) ) { 
  18. exit;