acf_field_select::update_field()publicACF 3.6

This filter is appied to the $field before it is saved to the database

@type filter

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

Хуков нет.

Возвращает

$field. - the modified field

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

$acf_field_select = new acf_field_select();
$acf_field_select->update_field( $field );
$field (обязательный)
-

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

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

Код acf_field_select::update_field() ACF 5.10.2

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
	return $field;
}