WordPress at a glance

get_site_option() WP 1.0

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

  • See: get_network_option()
  • Since 4.4.0 The $use_cache parameter was deprecated.
  • Since 4.4.0 Modified into wrapper for get_network_option()
Works based on: get_network_option()

No Hooks.

Return

Mixed. Value set for the option.

Usage

get_site_option( $option, $default, $deprecated );
$option(string) (required)
Name of option to retrieve. Expected to not be SQL-escaped.
$default(mixed)
Optional value to return if option doesn't exist.
Default: false
$deprecated(true/false)
Whether to use cache. Multisite only. Always set to true.
Default: true

Code of get_site_option: wp-includes/option.php VER 4.9.8

<?php
function get_site_option( $option, $default = false, $deprecated = true ) {
	return get_network_option( null, $option, $default );
}

Related Functions

From tag: Options API (settings)

No comments
    Hello, !     Log In . Register