Function: add_site_option

add_site_option( string $option, mixed $value )

Add a new option for the current network.

Existing options will not be updated. Note that prior to 3.3 this wasn't the case.

Parameters

Name Type(s) Default Value Description
$option string

Name of option to add. Expected to not be SQL-escaped.

$value mixed

Option value, can be anything. Expected to not be SQL-escaped.

Returns

boolean

False if the option was not added. True if the option was added.

WordPress Developer Newsletter

Stay on top of the latest WordPress API changes, developer tool updates, security alerts and more.