函数原型
get_site_option( string $option, mixed $default = false, bool $deprecated = true ): mixed
函数描述
Retrieve an option value for the current network based on name of option.
是否弃用
未弃用
函数参数
-
$option
string
Required - Name of the option to retrieve. Expected to not be SQL-escaped.
-
$default
mixed
Optional - Value to return if the option doesn’t exist.
Default:
false -
$deprecated
bool
Optional - Whether to use cache. Multisite only. Always set to true.
Default:
true
函数返回值
mixed Value set for the option.
函数位置
File: wp-includes/option.php.
函数源码
function get_site_option( $option, $default = false, $deprecated = true ) {
return get_network_option( null, $option, $default );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 4.4.0 | Modified into wrapper for get_network_option() |
| 2.8.0 | Introduced. |

