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 Description


Parameters Parameters

$field_type

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

$field_value

(Required) The actual value.


Top ↑

Return Return

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


Top ↑

Source 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 );
}

Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.