WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

WPMU Functions/add site option

Description

Adds a new site option and returns the ID of the inserted post in the table (wp_sitemeta).

Existing site options will not be updated by this function.

NB: Prior to WordPress 3.3 this was not the case. Previously this function would overwrite an option of the same name which already existed. You may have to be careful to check that the option does not already exist if you do not want to overwrite it.

Parameters

$key
(string) (required) The name of the site option to set.
Default: None
$value
(string or array) (required) The value of the site option.
Default: None

Return Values

(int) 
Returns the value of the inserted rows id.

Usage

<?php add_site_option($key$value); ?>

Notes

To get the value that has been set is done by using the function WPMU_Functions/get_site_option.