xprofile_format_profile_field( string $field_type, string $field_value )

Formats a profile field according to its type. [ TODO: Should really be moved to filters ]

Description

Parameters

$field_type

(string) (Required) The type of field: datebox, selectbox, textbox etc.

$field_value

(string) (Required) The actual value.

Return

(string|bool) The formatted value, or false if value is empty.

Source

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

function xprofile_format_profile_field( $field_type, $field_value ) {

	if ( empty( $field_value ) ) {
		return false;
	}

	$field_value = bp_unserialize_profile_field( $field_value );

	if ( 'datebox' != $field_type ) {
		$content = $field_value;
		$field_value = str_replace( ']]>', ']]>', $content );
	}

	return xprofile_filter_format_field_value_by_type( stripslashes_deep( $field_value ), $field_type );
}

Changelog

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