acf_field_select::update_fieldpublicACF 3.6

Filters the $field before it is saved to the database.

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

Хуков нет.

Возвращает

Массив.

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

$acf_field_select = new acf_field_select();
$acf_field_select->update_field( $field );
$field(массив) (обязательный)
The field array holding all the field options.

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

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

Код acf_field_select::update_field() ACF 6.4.2

public function update_field( $field ) {
	// Decode choices (convert to array).
	$field['choices']       = acf_decode_choices( $field['choices'] );
	$field['default_value'] = acf_decode_choices( $field['default_value'], true );

	// Convert back to string for single selects.
	if ( ! $field['multiple'] ) {
		$field['default_value'] = acf_unarray( $field['default_value'] );
	}

	return $field;
}