ACF\Meta

Option::update_reference │ public │ ACF 6.4

Updates a reference key in the database.

Method of the class: Option{}

No Hooks.

Returns

integer|boolean.

Usage

$Option = new Option();
$Option->update_reference( $object_id, $field_name, $value );
$object_id(int|string)
The ID of the object the metadata is for.
$field_name(string)
The name of the field to update the reference for.
Default: ''
$value(string)
The value of the reference key.
Default: ''

Changelog

Since 6.4 Introduced.

Option::update_reference() code ACF 6.8.8

public function update_reference( $object_id = 0, string $field_name = '', string $value = '' ) {
	$autoload = (bool) acf_get_setting( 'autoload' );
	return update_option( $this->reference_prefix . $object_id . '_' . $field_name, $value, $autoload );
}