ACF\Meta

MetaLocation::update_metapublicACF 6.4

Updates an object ID with the provided meta array.

Method of the class: MetaLocation{}

No Hooks.

Returns

null. Nothing (null).

Usage

$MetaLocation = new MetaLocation();
$MetaLocation->update_meta( $object_id, $meta );
$object_id(int|string)
The ID of the object the metadata is for.
$meta(array)
The metadata to save to the object.
Default: array()

Changelog

Since 6.4 Introduced.

MetaLocation::update_meta() code ACF 6.8.8

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