Retrieve an option value for the current network based on name of option.
$optionstringrequired
$default_valuemixedoptional
Default:false
$deprecatedbooloptional
Default:true
This function is almost identical to get_option(), except that in multisite, it returns the network-wide option. For non-multisite installs, it uses get_option.
It is easy to get confused about the difference between get_option() and get_site_option() , because multisite used different terms before. Now there are different “sites” on a “network”, before there where different “blogs” on a “site”. Many functions and variables were introduced before this change, such as this one. Think of this function as “get_network_option()“
function get_site_option( $option, $default_value = false, $deprecated = true ) {
return get_network_option( null, $option, $default_value );
}
| Version | Description |
|---|---|
| 4.4.0 | Modified into wrapper for get_network_option() |
| 2.8.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_site_option