get_site_option

Retrieve an option value for the current network based on name of option.

Description

get_site_option( (string) $option, (constant) $default = false, (bool) $deprecated = true ); 

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

  1. if ( !function_exists( 'get_site_option' ) ) { 
  2. require_once ABSPATH . WPINC . '/option.php'; 
  3.  
  4. // Name of option to retrieve. Expected to not be SQL-escaped. 
  5. $option = ''; 
  6.  
  7. // Optional value to return if option doesn't exist. Default false. 
  8. $default = false; 
  9.  
  10. // Whether to use cache. Multisite only. Always set to true. 
  11. $deprecated = true; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = get_site_option($option, $default, $deprecated); 
  15.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/option.php  
  1. function get_site_option( $option, $default = false, $deprecated = true ) { 
  2. return get_network_option( null, $option, $default );