update_site_option() WordPress Function

The update_site_option() function updates the value of a site option with a new value. The function takes two parameters: the option name and the new value. The function returns the old value if the update was successful, or false if the update failed.

update_site_option( string $option, mixed $value ) #

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


Description

Top ↑

See also


Top ↑

Parameters

$option

(string)(Required)Name of the option. Expected to not be SQL-escaped.

$value

(mixed)(Required)Option value. Expected to not be SQL-escaped.


Top ↑

Return

(bool) True if the value was updated, false otherwise.


Top ↑

Source

File: wp-includes/option.php

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


Top ↑

Changelog

Changelog
VersionDescription
4.4.0Modified into wrapper for update_network_option()
2.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More