ACF\Meta
Option::update_reference
Updates a reference key in the database.
Метод класса: Option{}
Хуков нет.
Возвращает
Int|true|false
.
Использование
$Option = new Option(); $Option->update_reference( $object_id, $field_name, $value );
- $object_id(int|строка)
- The ID of the object the metadata is for.
- $field_name(строка)
- The name of the field to update the reference for.
По умолчанию: '' - $value(строка)
- The value of the reference key.
По умолчанию: ''
Список изменений
С версии 6.4 | Введена. |
Код Option::update_reference() Option::update reference ACF 6.4.2
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 ); }