bp_core_get_settings_admin_active_tab( string $active_tab = '' )
Get the data for the settings tabs in the admin area.
Description
Parameters
- $active_tab
-
(Optional) Name of the tab that is active. Optional.
Default value: ''
Return
(string)
Source
File: bp-core/admin/bp-core-admin-functions.php
function bp_core_get_settings_admin_active_tab( $active_tab = '' ) { global $bp_admin_setting_tabs; if ( ! $bp_admin_setting_tabs ) { $bp_admin_setting_tabs = []; } uasort($bp_admin_setting_tabs, function($a, $b) { return $a->tab_order - $b->tab_order; }); $tabs = array_filter($bp_admin_setting_tabs, function($tab) { return $tab->is_tab_visible(); }); $tabs = array_map(function($tab) { return [ 'href' => bp_core_admin_setting_url( $tab->tab_name ), 'name' => $tab->tab_label, 'slug' => $tab->tab_name ]; }, $tabs); // Remove the credit tab from the settings tab. unset( $tabs['bp-credit']) ; /** * Filters the tab data used in our wp-admin screens. * * @since BuddyPress 2.2.0 * * @param array $tabs Tab data. */ return apply_filters( 'bp_core_get_settings_admin_active_tab', $tabs ); }
Changelog
Version | Description |
---|---|
BuddyPress 2.2.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.