acf_field_post_object::format_value_for_restpublicACF 5.11

Apply basic formatting to prepare the value for default REST output.

Method of the class: acf_field_post_object{}

No Hooks.

Returns

mixed.

Usage

$acf_field_post_object = new acf_field_post_object();
$acf_field_post_object->format_value_for_rest( $value, $post_id, $field );
$value(mixed) (required)
The raw (unformatted) field value.
$post_id(int|string) (required)
The post ID being queried.
$field(array) (required)
The field array.

Changelog

Since 5.11 Introduced.

acf_field_post_object::format_value_for_rest() code ACF 6.8.8

public function format_value_for_rest( $value, $post_id, array $field ) {
	return acf_format_numerics( $value );
}