Function: add_network_option

add_network_option( integer $network_id, string $option, mixed $value )

Add a new network option.

Existing options will not be updated.

Parameters

Name Type(s) Default Value Description
$network_id integer

ID of the network. Can be null to default to the current network ID.

$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 option was not added and true if option was added.

WordPress Developer Newsletter

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