Function: get_site_option

get_site_option( string $option, mixed $default, boolean $deprecated )

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

Shortcut: gso

You can use above key combination to trigger the associated snippet for this function in the WordPress Snippets for Visual Studio Code extension. You can also use this shortcut to search for this function on this website.


Name Type(s) Default Value Description
$option string

Name of option to retrieve. Expected to not be SQL-escaped.

$default mixed false

Optional value to return if option doesn't exist. Default false.

$deprecated boolean true

Whether to use cache. Multisite only. Always set to true.



Value set for the option.

WordPress Developer Newsletter

Stay informed of new chapter releases, important WordPress API updates and more.