acf_field_gallery::update_value()publicACF 3.6

This filter is appied to the $value before it is updated in the db

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

Хуков нет.

Возвращает

$value. - the modified value

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

$acf_field_gallery = new acf_field_gallery();
$acf_field_gallery->update_value( $value, $post_id, $field );
$value (обязательный)
-
$post_id (обязательный)
-
$field (обязательный)
-

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

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

Код acf_field_gallery::update_value() ACF 6.0.4

function update_value( $value, $post_id, $field ) {

	// Bail early if no value.
	if ( empty( $value ) ) {
		return $value;
	}

	// Convert to array.
	$value = acf_array( $value );

	// Format array of values.
	// - ensure each value is an id.
	// - Parse each id as string for SQL LIKE queries.
	$value = array_map( 'acf_idval', $value );
	$value = array_map( 'strval', $value );

	// Return value.
	return $value;

}