bp_nouveau_search_object_data_attr( string $attr = '' )

Output the search form data-bp attribute.

Description

Parameters

$attr

(string) (Optional) The data-bp attribute.

Default value: ''

Return

(string) The data-bp attribute.

Source

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

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.