acf_field_color_picker::format_value │ public │ ACF 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.

Метод класса: acf_field_color_picker{}

Хуков нет.

Возвращает

string|array.

Использование

$acf_field_color_picker = new acf_field_color_picker();
$acf_field_color_picker->format_value( $value, $post_id, $field );
$value(разное) (обязательный)
The field value.
$post_id(int) (обязательный)
The post ID.
$field(массив) (обязательный)
The field array.

Список изменений

С версии 5.10 Введена.

Код acf_field_color_picker::format_value() ACF 6.8.8

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