bp_core_get_admin_tabs

Get the data for the tabs in the admin area.

Description

(string) bp_core_get_admin_tabs( (string) $active_tab = '' ); 

Returns (string)

Parameters (1)

0. $active_tab — Optional. (string) => ''
Name of the tab that is active. Optional.

Usage

  1. if ( !function_exists( 'bp_core_get_admin_tabs' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/admin/bp-core-admin-functions.php'; 
  3.  
  4. // Name of the tab that is active. Optional. 
  5. $active_tab = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_core_get_admin_tabs($active_tab); 
  9.  

Defined (1)

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

/bp-core/admin/bp-core-admin-functions.php  
  1. function bp_core_get_admin_tabs( $active_tab = '' ) { 
  2. $tabs = array( 
  3. '0' => array( 
  4. 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), 'admin.php' ) ),  
  5. 'name' => __( 'Components', buddypress ) 
  6. ),  
  7. '1' => array( 
  8. 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) ),  
  9. 'name' => __( 'Pages', buddypress ) 
  10. ),  
  11. '2' => array( 
  12. 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), 'admin.php' ) ),  
  13. 'name' => __( 'Options', buddypress ) 
  14. ),  
  15. ); 
  16.  
  17. // If forums component is active, add additional tab. 
  18. if ( bp_is_active( 'forums' ) && class_exists( 'BP_Forums_Component' ) ) { 
  19.  
  20. // Enqueue thickbox. 
  21. wp_enqueue_script( 'thickbox' ); 
  22. wp_enqueue_style( 'thickbox' ); 
  23.  
  24. $tabs['3'] = array( 
  25. 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bb-forums-setup' ), 'admin.php' ) ),  
  26. 'name' => __( 'Forums', buddypress ) 
  27. ); 
  28.  
  29. /** 
  30. * Filters the tab data used in our wp-admin screens. 
  31. * @since 2.2.0 
  32. * @param array $tabs Tab data. 
  33. */