BP_REST_XProfile_Fields_Endpoint::get_profile_field_unserialized_value( string $value = '', integer|BP_XProfile_Field $profile_field = null )

Retrieve the unserialized value of a profile field.

Description

Parameters

$value

(Optional) The raw value of the field.

Default value: ''

$profile_field

(Optional) The ID or the full object for the field.

Default value: null

Return

(array) The unserialized field value.

Source

File: bp-xprofile/classes/class-bp-rest-xprofile-fields-endpoint.php

	public function get_profile_field_unserialized_value( $value = '' ) {
		if ( empty( $value ) ) {
			return array();
		}

		$unserialized_value = maybe_unserialize( $value );
		if ( ! is_array( $unserialized_value ) ) {
			$unserialized_value = (array) $unserialized_value;
		}

		return $unserialized_value;
	}

Changelog

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