update_meta()WP 1.2.0

Updates post meta data by meta ID.

No Hooks.

Return

true|false.

Usage

update_meta( $meta_id, $meta_key, $meta_value );
$meta_id(int) (required)
Meta ID.
$meta_key(string) (required)
Meta key. Expect slashed.
$meta_value(string) (required)
Meta value. Expect slashed.

Changelog

Since 1.2.0 Introduced.

update_meta() code WP 6.5.4

function update_meta( $meta_id, $meta_key, $meta_value ) {
	$meta_key   = wp_unslash( $meta_key );
	$meta_value = wp_unslash( $meta_value );

	return update_metadata_by_mid( 'post', $meta_id, $meta_value, $meta_key );
}