add_site_meta( int $site_id, string $meta_key, mixed $meta_value, bool $unique = false )
向网站添加元数据。
Adds metadata to a site.
目录锚点:#参数#返回#源码
参数 |
类型 |
必填 |
说明 |
$site_id |
(int) |
必需 |
站点ID。 |
$meta_key |
(string) |
必需 |
元数据名称。 |
$meta_value |
(mixed) |
必需 |
元数据值。如果不是标量,则必须是可序列化的。 |
$unique |
(bool) |
可选 |
是否不应添加相同的密钥。 |
(int|false)Meta ID表示成功,false表示失败。
function add_site_meta( $site_id, $meta_key, $meta_value, $unique = false ) {
return add_metadata( 'blog', $site_id, $meta_key, $meta_value, $unique );
}
更新版本 |
源码位置 |
使用 |
被使用 |
5.1.0 |
wp-includes/ms-site.php:1047 |
0 |
1 function |