WordPress at a glance

get_site_option() WP 1.0

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

Возвращает

Mixed. Value set for the option.

Works based on: get_network_option()

No Hooks.

Usage

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

Notes

  • See: get_network_option()

Список изменений

С версии 2.8.0 Введена.
С версии 4.4.0 The $use_cache parameter was deprecated.
С версии 4.4.0 Modified into wrapper for get_network_option()

Code of get_site_option() WP 5.5.1

wp-includes/option.php
<?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
    Log In . Register