bp_get_field_data_attribute( string|bool $attribute = false )

Return the data attribute for a field.

Description

Parameters

$attribute

(string|bool) (Optional) Extra data to append to data attribute.

Default value: false

Return

(string)

Source

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

function bp_get_field_data_attribute( $attribute = false ) {
	global $profile_template;

	$data_attribute = array();

	$data_attribute[] = ' data-index="' . $profile_template->field->field_order . '" ';

	/**
	 * Filters the field data to be applied to a field.
	 *
	 * @since BuddyBoss 1.1.6
	 *
	 * @param array $data_attribute Array of data attribute to be applied to field. Passed by reference.
	 */
	$data_attribute = apply_filters_ref_array( 'bp_field_data_attribute', array( &$data_attribute ) );

	/**
	 * Filters the data HTML attribute to be used on a field.
	 *
	 * @since BuddyBoss 1.1.6
	 *
	 * @param string $value data HTML attribute with imploded data attributes.
	 */
	return apply_filters( 'bp_get_field_data_attribute', implode( ' ', $data_attribute ) . '"' );
}

Changelog

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