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
553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 | 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.