acf_field_color_picker::format_valuepublicACF 5.10

Format the value for use in templates. At this stage, the value has been loaded from the database and is being returned by an API function such as get_field(), the_field(), etc.

Method of the class: acf_field_color_picker{}

No Hooks.

Returns

String|Array.

Usage

$acf_field_color_picker = new acf_field_color_picker();
$acf_field_color_picker->format_value( $value, $post_id, $field );
$value(mixed) (required)
.
$post_id(int) (required)
.
$field(array) (required)
.

Changelog

Since 5.10 Introduced.

acf_field_color_picker::format_value() code ACF 6.0.4

public function format_value( $value, $post_id, $field ) {
	if ( isset( $field['return_format'] ) && $field['return_format'] === 'array' ) {
		$value = $this->string_to_array( $value );
	}

	return $value;
}