bb_global_profile_menu_structure

Profile/Admin.

Description

bb_global_profile_menu_structure(); 

Usage

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

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-core.php  
  1. function bb_global_profile_menu_structure() { 
  2. global $user_id, $profile_menu, $profile_hooks; 
  3. // Menu item name 
  4. // The capability required for own user to view the tab ('' to allow non logged in access) 
  5. // The capability required for other users to view the tab ('' to allow non logged in access) 
  6. // The URL of the item's file 
  7. // Item name for URL (nontranslated) 
  8. $profile_menu[0] = array(__('Edit'), 'edit_profile', 'edit_users', 'profile-edit.php', 'edit'); 
  9. $profile_menu[5] = array(__('Favorites'), '', '', 'favorites.php', 'favorites'); 
  10.  
  11. // Create list of page plugin hook names the current user can access 
  12. $profile_hooks = array(); 
  13. foreach ($profile_menu as $profile_tab) 
  14. if ( bb_can_access_tab( $profile_tab, bb_get_current_user_info( 'id' ), $user_id ) ) 
  15. $profile_hooks[bb_sanitize_with_dashes($profile_tab[4])] = $profile_tab[3]; 
  16.  
  17. ksort($profile_menu);