函数原型
add_site_option( string $option, mixed $value ): bool
函数描述
Adds a new option for the current network.
是否弃用
未弃用
函数参数
-
$option
string
Required - Name of the option to add. Expected to not be SQL-escaped.
-
$value
mixed
Required - Option value, can be anything. Expected to not be SQL-escaped.
函数返回值
bool True if the option was added, false otherwise.
函数位置
File: wp-includes/option.php.
函数源码
function add_site_option( $option, $value ) {
return add_network_option( null, $option, $value );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 4.4.0 | Modified into wrapper for add_network_option() |
| 2.8.0 | Introduced. |

