WPDev.one
Core Function
View Source on Trac ↗

update_site_meta()

update_site_meta( mixed $site_id, mixed $meta_key, mixed $meta_value, mixed $prev_value = '' )

Updates metadata for a site.

Parameters 4 required

Name / Type Description
$site_id
int

Site ID.

Required
$meta_key
string

Metadata key.

Required
$meta_value
mixed

Metadata value. Must be serializable if non-scalar.

Required
mixed

$prev_value Optional. Previous value to check before updating. If specified, only update existing metadata entries with this value. Otherwise, update all entries. Default empty.

Required

Return Value

((int)
(int | bool) Meta ID if the key didn't exist, true on successful update, false on failure or if the value passed to the function is the same as the one that is already in the database.

Function Information

Since Version
5.1.0
Source File
wp-includes/ms-site.php
Advertisement