WPDev.one
Core Function
View Source on Trac ↗

update_metadata_by_mid()

update_metadata_by_mid( mixed $meta_type, mixed $meta_id, mixed $meta_value, mixed $meta_key = false )

Updates metadata by meta ID.

Parameters 4 required

Name / Type Description
string

$meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', or any other object type with an associated meta table.

Required
$meta_id
int

ID for a specific meta row.

Required
$meta_value
string

Metadata value. Must be serializable if non-scalar.

Required
(string

| false) $meta_key Optional. You can provide a meta key to update it. Default false.

Required

Return Value

(bool)
True on successful update, false on failure.

Function Information

Since Version
3.3.0
Source File
wp-includes/meta.php
Advertisement