bp_nouveau_search_object_data_attr( string $attr = '' )

Output the search form data-bp attribute.

Description

Parameters

$attr

(Optional) The data-bp attribute.

Default value: ''

Return

(string) The data-bp attribute.

Source

File: bp-templates/bp-nouveau/includes/template-tags.php

1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
function bp_nouveau_search_object_data_attr( $attr = '' ) {
    $objects = bp_nouveau_get_search_objects();
 
    if ( ! isset( $objects['secondary'] ) ) {
        return $attr;
    }
 
    if ( bp_is_active( 'groups' ) && bp_is_group_members() ) {
        $attr = join( '_', $objects );
    } elseif ( bp_is_active( 'groups' ) && bp_is_group_subgroups() ) {
        $attr = 'group_subgroups';
    } else {
        $attr = $objects['secondary'];
    }
 
    echo esc_attr( $attr );
}

Changelog

Changelog
Version Description
BuddyPress 3.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.