ACF\Meta

Option::update_metapublicACF 6.4

Updates an object ID with the provided meta array.

Method of the class: Option{}

No Hooks.

Returns

void. Nothing (null).

Usage

$Option = new Option();
$Option->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.

Option::update_meta() code ACF 6.8.8

public function update_meta( $object_id = 0, array $meta = array() ) {
	$autoload = (bool) acf_get_setting( 'autoload' );

	foreach ( $meta as $name => $value ) {
		$value = wp_unslash( $value );
		update_option( $object_id . '_' . $name, $value, $autoload );
	}
}