WordPress.org

Ready to get started?Download WordPress

Codex

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

WPMU Functions/get blog option

This article has been requested to be merged into Function_Reference/get_blog_option.

Description

Returns data relating to a specific blog.

Parameters

$blog_id
(integer) (required) ID of blog queried.
Default: None
$setting
(string) (required) Name of setting to fetch.
Default: None
$default
(integer) (optional) Deprecated.
Default: false

Options

Any settings in the wp_(blog_id)_options table can be fetched using this function including:

siteurl 
Full URL of the blog queried (eg. http://www.example.com/blog).
blogname 
Name of the blog queried.
blogdescription 
Description of the blog queried.
wp_#_user_roles 
Roles available in this blog (where # is the ID of the blog being queried).
users_can_register 
Flag indicating if users can register on the queried blog.
admin_email 
Email address of the admin user of the blog queried.
start_of_week 
Day of the week set as the week start for the blog queried.
use_balanceTags 
Flag indicating if the queried blog uses balanced tags.
use_smilies 
Flag indicating if the queried blog converts text smilies to images.
require_name_email 
Flag indicating if the queried blog requires names and emails in posted comments.
comments_notify 
Flag indicating if the queried blog notifies the admin user when a new comment is posted.
posts_per_rss 
Number of posts carried in the queried blog's RSS feed.
rss_excerpt_length 
Length of excerpt carried in the queried blog's RSS feed.
rss_use_excerpt 
Flag indicating if the queried blog's RSS feed carries a post's excerpt.
mailserver_url 
URL of mail server used when sending email from the queried blog.
mailserver_login 
Username used with the above mail server.
mailserver_pass 
Password used with the above username and mail server.
mailserver_port 
Port used with the above mail server.
default_category 
ID of category in which blog posts are published by default.
default_comment_status 
Status comments are set to when posted by default.
default_ping_status 
Ping status set by default when new blog posts are published.
default_pingback_flag 
Flag indicating the default status of pingbacks when new blog posts are published.
default_post_edit_rows 
Default size of the post edit box.
posts_per_page 
Number of posts displayed per page on the bog queried.
what_to_show 
[unknown]
date_format 
Format in which dates are disaplyed on the blog queried.
time_format 
Format in which times are displayed on the blog queried.
links_updated_date_format 
[unknown]
links_recently_updated_append 
[unknown]

Return Values

(mixed) 
The value of the setting requested.

Usage

<?php get_blog_option($blog_id$setting$default); ?>

Examples

<?php
$blog_id 
1;
echo 
'Blog '.$blog_id.' is called '.get_blog_option$blog_id'blogname' );
?>

Notes

Pulls the provided information from the wp_#_options table.