bp_core_admin_groups_tabs( string $active_tab = '' )

Output the tabs in the admin area.

Description

Parameters

$active_tab

(Optional) Name of the tab that is active. Optional.

Default value: ''

Source

File: bp-core/admin/bp-core-admin-functions.php

2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
function bp_core_admin_groups_tabs( $active_tab = '' ) {
 
    $tabs_html    = '';
    $idle_class   = 'nav-tab';
    $active_class = 'nav-tab nav-tab-active';
 
    /**
     * Filters the admin tabs to be displayed.
     *
     * @since BuddyBoss 1.0.0
     *
     * @param array $value Array of tabs to output to the admin area.
     */
    $tabs         = apply_filters( 'bp_core_admin_groups_tabs', bp_core_get_groups_admin_tabs( $active_tab ) );
 
    // Loop through tabs and build navigation.
    foreach ( array_values( $tabs ) as $tab_data ) {
        $is_current = (bool) ( $tab_data['name'] == $active_tab );
        $tab_class  = $is_current ? $tab_data['class'].' '.$active_class : $tab_data['class'].' '.$idle_class;
        $tabs_html .= '<a href="' . esc_url( $tab_data['href'] ) . '" class="' . esc_attr( $tab_class ) . '">' . esc_html( $tab_data['name'] ) . '</a>';
    }
 
    echo $tabs_html;
 
    /**
     * Fires after the output of tabs for the admin area.
     *
     * @since BuddyBoss 1.0.0
     */
    do_action( 'bp_admin_groups_tabs' );
}

Changelog

Changelog
Version Description
BuddyBoss 1.0.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.