ACF\Meta

Option::update_valuepublicACF 6.4

Updates a field value in the database.

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

Хуков нет.

Возвращает

Int|true|false.

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

$Option = new Option();
$Option->update_value( $object_id, $field, $value );
$object_id(int|строка)
The ID of the object the metadata is for.
$field(массив)
The field array.
По умолчанию: array()
$value(разное)
The metadata value.
По умолчанию: ''

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

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

Код Option::update_value() ACF 6.4.2

public function update_value( $object_id = 0, array $field = array(), $value = '' ) {
	$value    = wp_unslash( $value );
	$autoload = (bool) acf_get_setting( 'autoload' );

	return update_option( $object_id . '_' . $field['name'], $value, $autoload );
}