ACF\Meta

Option::update_valuepublicACF 6.4

Updates a field value in the database.

Method of the class: Option{}

No Hooks.

Returns

Int|true|false.

Usage

$Option = new Option();
$Option->update_value( $object_id, $field, $value );
$object_id(int|string)
The ID of the object the metadata is for.
$field(array)
The field array.
Default: array()
$value(mixed)
The metadata value.
Default: ''

Changelog

Since 6.4 Introduced.

Option::update_value() code ACF 6.8.8

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 );
}