update_site_option()WP 2.8.0

Update the value of an option that was already added for the current network.

No Hooks.

Return

true|false. True if the value was updated, false otherwise.

Usage

update_site_option( $option, $value );
$option(string) (required)
Name of the option. Expected to not be SQL-escaped.
$value(mixed) (required)
Option value. Expected to not be SQL-escaped.

Examples

0

#1 Save the network of sites option and get it

update_site_option( 'my_site_option', 321 );

echo get_site_option( 'my_site_option' ); //> 321 

Notes

Changelog

Since 2.8.0 Introduced.
Since 4.4.0 Modified into wrapper for update_network_option()

update_site_option() code WP 6.4.3

function update_site_option( $option, $value ) {
	return update_network_option( null, $option, $value );
}