Summery Summery

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

Syntax Syntax

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

Parameters Parameters


(string) (Required) Name of option to retrieve. Expected to not be SQL-escaped.


(mixed) (Optional) value to return if option doesn't exist.

Default value: false


(bool) (Optional) Whether to use cache. Multisite only. Always set to true.

Default value: true

Return Return

(mixed) Value set for the option.

Source Source

File: wp-includes/option.php

	if ( isset( $_COOKIE[ 'wp-settings-' . $user_id ] ) ) {
		$cookie = preg_replace( '/[^A-Za-z0-9=&_-]/', '', $_COOKIE[ 'wp-settings-' . $user_id ] );


Changelog Changelog

Version Description
4.4.0 Modified into wrapper for get_network_option()
2.8.0 Introduced.

See also See also


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.