acf_update_values()ACF 5.7.13

acf_update_values

Updates an array of values.

No Hooks.

Returns

void. Nothing (null).

Usage

acf_update_values( $values, $post_id );
$values(required)
.
$post_id((int|string)) (required)
The post id.

Changelog

Since 5.7.13 Introduced.

acf_update_values() code ACF 6.8.8

function acf_update_values( $values, $post_id ) {

	// Loop over values.
	foreach ( $values as $key => $value ) {

		// Get field.
		$field = acf_get_field( $key );

		// Update value.
		if ( $field ) {
			acf_update_value( $value, $post_id, $field );
		}
	}
}