WordPress.org

Codex

Function Reference/get site option

Contents

Description

Retrieve option value based on name of option. In multisite, return network option, blog option otherwise.

Usage

<?php get_site_option$option$default $use_cache ?>

Parameters

$option
(string) (required) Name of option to retrieve. Expected to not be SQL-escaped .
Default: None
$default
(mixed) (optional) Optional value to return if option doesn't exist.
Default: false
$use_cache
(boolean) (optional) Whether to use cache. Multisite only.
Default: true

Return Values

(mixed) 
Value set for the option.

Examples

echo get_site_option('siteurl');

Notes

Change Log

since 2.8.0

Source File

get_site_option() is located in wp-includes/option.php.

Related

See also index of Function Reference and index of Template Tags.