add_site_meta

函数


add_site_meta ( $site_id, $meta_key, $meta_value, $unique = false )
参数
  • (int)
    $site_id
    Site ID.
    Required:
  • (string)
    $meta_key
    Metadata name.
    Required:
  • (mixed)
    $meta_value
    Metadata value. Must be serializable if non-scalar.
    Required:
  • (bool)
    $unique
    Optional. Whether the same key should not be added. Default false.
    Required:
    Default: false
返回值
  • (int|false) Meta ID on success, false on failure.
定义位置
  • wp-includes/ms-site.php
    , line 1016
引入
5.1.0
弃用

Adds metadata to a site.

function add_site_meta( $site_id, $meta_key, $meta_value, $unique = false ) {
	return add_metadata( 'blog', $site_id, $meta_key, $meta_value, $unique );
}