bb_add_profile_tab

The BuddyPress bb add profile tab function.

Description

bb_add_profile_tab( $tab_title, $users_cap, $others_cap, $file, (constant) $arg = false ); 

Parameters (5)

0. $tab_title
The tab title.
1. $users_cap
The users cap.
2. $others_cap
The others cap.
3. $file
The file.
4. $arg — Optional. (constant) => false
The arg.

Usage

  1. if ( !function_exists( 'bb_add_profile_tab' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-core.php'; 
  3.  
  4. // The tab title. 
  5. $tab_title = null; 
  6.  
  7. // The users cap. 
  8. $users_cap = null; 
  9.  
  10. // The others cap. 
  11. $others_cap = null; 
  12.  
  13. // The file. 
  14. $file = null; 
  15.  
  16. // The arg. 
  17. $arg = false; 
  18.  
  19. // NOTICE! Understand what this does before running. 
  20. $result = bb_add_profile_tab($tab_title, $users_cap, $others_cap, $file, $arg); 
  21.  

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-core.php  
  1. function bb_add_profile_tab($tab_title, $users_cap, $others_cap, $file, $arg = false) { 
  2. global $profile_menu, $profile_hooks, $user_id; 
  3.  
  4. $arg = $arg ? $arg : $tab_title; 
  5.  
  6. $profile_tab = array($tab_title, $users_cap, $others_cap, $file, $arg); 
  7. $profile_menu[] = $profile_tab; 
  8. if ( bb_can_access_tab( $profile_tab, bb_get_current_user_info( 'id' ), $user_id ) ) 
  9. $profile_hooks[bb_sanitize_with_dashes($arg)] = $file;