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

Retrieve the field raw data.

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) Field raw data.

Source

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

1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
public function get_profile_field_raw_value( $value = '', $profile_field = null ) {
    if ( empty( $value ) ) {
        return '';
    }
 
    if ( ! empty( $profile_field ) ) {
        $profile_field = xprofile_get_field( $profile_field );
 
        if ( ! isset( $profile_field->id ) ) {
            return '';
        }
 
        if ( 'telephone' === $profile_field->type ) {
            $value = wp_strip_all_tags( html_entity_decode( $value ) );
        }
    }
 
    return $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.