xprofile_filter_format_field_value_by_type( mixed $field_value, string $field_type = '', string|int $field_id = '' )

Apply display_filter() filters as defined by BP_XProfile_Field_Type classes, when inside a bp_has_profile() loop.

Description

Parameters

$field_value

(mixed) (Required) Field value.

$field_type

(string) (Optional) Field type.

Default value: ''

$field_id

(string|int) (Optional) ID of the field.

Default value: ''

Return

(mixed)

Source

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

function xprofile_filter_format_field_value_by_type( $field_value, $field_type = '', $field_id = '' ) {
	foreach ( bp_xprofile_get_field_types() as $type => $class ) {
		if ( $type !== $field_type ) {
			continue;
		}

		if ( method_exists( $class, 'display_filter' ) ) {
			$field_value = call_user_func( array( $class, 'display_filter' ), $field_value, $field_id );
		}
	}

	return $field_value;
}

Changelog

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