get_site_option
Retrieve an option value for the current network based on name of option.
Description
Parameters (3)
- 0. $option (string)
- Name of option to retrieve. Expected to not be SQL-escaped.
- 1. $default — Optional. (constant) =>
false
- Value to return if option doesn't exist. Default false.
- 2. $deprecated — Optional. (bool) =>
true
- Whether to use cache. Multisite only. Always set to true.
Usage
if ( !function_exists( 'get_site_option' ) ) { require_once ABSPATH . WPINC . '/option.php'; } // Name of option to retrieve. Expected to not be SQL-escaped. $option = ''; // Optional value to return if option doesn't exist. Default false. $default = false; // Whether to use cache. Multisite only. Always set to true. $deprecated = true; // NOTICE! Understand what this does before running. $result = get_site_option($option, $default, $deprecated);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/option.php
- function get_site_option( $option, $default = false, $deprecated = true ) {
- return get_network_option( null, $option, $default );
- }