add_site_meta() WordPress Function
The add_site_meta() function is used to add meta data to a site. The function takes two arguments: the key of the meta data and the value of the meta data. The key can be any string, but the value must be a string or an array.
add_site_meta( int $site_id, string $meta_key, mixed $meta_value, bool $unique = false ) #
Adds metadata to a site.
Parameters
- $site_id
(int)(Required)Site ID.
- $meta_key
(string)(Required)Metadata name.
- $meta_value
(mixed)(Required)Metadata value. Must be serializable if non-scalar.
- $unique
(bool)(Optional) Whether the same key should not be added.
Default value: false
Return
(int|false) Meta ID on success, false on failure.
Source
File: wp-includes/ms-site.php
function add_site_meta( $site_id, $meta_key, $meta_value, $unique = false ) { return add_metadata( 'blog', $site_id, $meta_key, $meta_value, $unique ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
5.1.0 | Introduced. |