bp_core_get_users_admin_tabs( string $active_tab = '' )

Register tabs for the BuddyBoss > Groups screens.

Description

Parameters

$active_tab

(Optional)

Default value: ''

Return

(array)

Source

File: bp-xprofile/bp-xprofile-admin.php

1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
function bp_core_get_users_admin_tabs( $active_tab = '') {
 
    $tabs = array();
 
    // Check profile type enabled.
    $is_member_type_enabled = bp_member_type_enable_disable();
 
    // Check profile search enabled.
    $is_profile_search_enabled = bp_disable_advanced_profile_search();
 
    $tabs[] = array(
        'href'  => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-profile-setup' ), 'admin.php' ) ),
        'name'  => __( 'Profile Fields', 'buddyboss' ),
        'class' => 'bp-profile-fields',
    );
 
    if ( true === $is_member_type_enabled ) {
 
        if ( is_network_admin() && bp_is_network_activated() ) {
            $profile_url = get_admin_url( bp_get_root_blog_id(), 'edit.php?post_type=bp-member-type' );
        } else {
            $profile_url = bp_get_admin_url( add_query_arg( array( 'post_type' => 'bp-member-type' ), 'edit.php' ) );
        }
 
        $tabs[] = array(
            'href'  => $profile_url,
            'name'  => __( 'Profile Types', 'buddyboss' ),
            'class' => 'bp-profile-types',
        );
    }
 
    if ( false === $is_profile_search_enabled ) {
        $tabs[] = array(
            'href'  => bp_get_admin_url( add_query_arg( array( 'post_type' => 'bp_ps_form' ), 'edit.php' ) ),
            'name'  => __( 'Profile Search', 'buddyboss' ),
            'class' => 'bp-profile-search',
        );
    }
 
    $query['autofocus[section]'] = 'bp_nouveau_user_primary_nav';
    $section_link = add_query_arg( $query, admin_url( 'customize.php' ) );
    $tabs[] = array(
        'href'  => esc_url( $section_link ),
        'name'  => __( 'Profile Navigation', 'buddyboss' ),
        'class' => 'bp-user-customizer',
    );
 
    /**
     * Filters the tab data used in our wp-admin screens.
     *
     * @since BuddyBoss 1.0.0
     *
     * @param array $tabs Tab data.
     */
    return apply_filters( 'bp_core_get_users_admin_tabs', $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.