WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/get blog option

Description

Retrieve option value based on setting name and blog_id.

If the option does not exist or does not have a value, then the return value will be false. This is useful to check whether you need to install an option and is commonly used during installation of plugin options and to test whether upgrading is required. There is a filter called 'blog_option_$option' with the $option being replaced with the option name. The filter takes two parameters. $value and $blog_id. It returns $value. The 'option_$option' filter in get_option() is not called.

Uses apply_filters() Calls 'blog_option_$optionname' with the option name value.

Usage

<?php get_blog_option$blog_id$setting$default ?>

Parameters

$blog_id
(integer) (required) is the id of the blog.
Default: None
$setting
(string) (required) Name of option to retrieve. Should already be SQL-escaped.
Default: None
$default
(string) (optional) Default value returned if option not found.
Default: false

Return Values

(mixed) 
Value set for the option.

Source File

get_blog_option() is located in wp-includes/ms-blogs.php