acf_field_color_picker::format_value()publicACF 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{}

Хуков нет.

Возвращает

Строку|Массив.

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

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

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

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

Код acf_field_color_picker::format_value() 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;
}