ACF\Meta

MetaLocation::update_metapublicACF 6.4

Updates an object ID with the provided meta array.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$MetaLocation = new MetaLocation();
$MetaLocation->update_meta( $object_id, $meta );
$object_id(int|строка)
The ID of the object the metadata is for.
$meta(массив)
The metadata to save to the object.
По умолчанию: array()

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

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

Код MetaLocation::update_meta() ACF 6.4.2

public function update_meta( $object_id = 0, array $meta = array() ) {
	// Slash data. WP expects all data to be slashed and will unslash it (fixes '\' character issues).
	$meta = wp_slash( $meta );

	foreach ( $meta as $name => $value ) {
		update_metadata( $this->location_type, $object_id, $name, $value );
	}
}