“WPMU Functions/get blog option”的版本间的差异

来自WordPress中文文档
跳转至: 导航搜索
(General elaboration and tidying.)
 
(1个修订)
(没有差异)

2009年3月14日 (六) 09:30的版本

Description

Returns data relating to a specific blog.

Parameters

tt$blog_id/tt
(integer) (required) ID of blog queried.
Default: Nonenoinclude

div class=template-description style=padding: 0 1.5em; border: 1px solid #eeeeee; background-color: #f9f9f9

Notes

This template is for standardizing how parameters look in the Function Reference and in Template Tags. Here is an example of this template being called: prenowiki检查到模板循环:模板:Parameter/nowiki/pre 检查到模板循环:模板:Parameter

The usage of this template is below: prenowiki检查到模板循环:模板:Parameter/nowiki/pre Let's take a closer look at the parameters..

name
The name of the parameter.
datatype
The datatype that should be given for this parameter when called.
  • string
  • integer
  • boolean
  • mixed
description
A short description of the parameter.
importance
Set this parameter to optional if the parameter is optional. Otherwise, do not declare this parameter—it defaults to required.
  • required
  • optional
default
If this parameter is optional, ttdefault/tt is the value that will be used if the parameter is not declared.

wordpress.org.cn /div /noinclude

tt$setting/tt
(string) (required) Name of setting to fetch (see usage).
Default: Nonenoinclude

div class=template-description style=padding: 0 1.5em; border: 1px solid #eeeeee; background-color: #f9f9f9

Notes

This template is for standardizing how parameters look in the Function Reference and in Template Tags. Here is an example of this template being called: prenowiki检查到模板循环:模板:Parameter/nowiki/pre 检查到模板循环:模板:Parameter

The usage of this template is below: prenowiki检查到模板循环:模板:Parameter/nowiki/pre Let's take a closer look at the parameters..

name
The name of the parameter.
datatype
The datatype that should be given for this parameter when called.
  • string
  • integer
  • boolean
  • mixed
description
A short description of the parameter.
importance
Set this parameter to optional if the parameter is optional. Otherwise, do not declare this parameter—it defaults to required.
  • required
  • optional
default
If this parameter is optional, ttdefault/tt is the value that will be used if the parameter is not declared.

wordpress.org.cn /div /noinclude

tt$deprecated/tt
(integer) (optional) Depreciated.
Default: [empty string]noinclude

div class=template-description style=padding: 0 1.5em; border: 1px solid #eeeeee; background-color: #f9f9f9

Notes

This template is for standardizing how parameters look in the Function Reference and in Template Tags. Here is an example of this template being called: prenowiki检查到模板循环:模板:Parameter/nowiki/pre 检查到模板循环:模板:Parameter

The usage of this template is below: prenowiki检查到模板循环:模板:Parameter/nowiki/pre Let's take a closer look at the parameters..

name
The name of the parameter.
datatype
The datatype that should be given for this parameter when called.
  • string
  • integer
  • boolean
  • mixed
description
A short description of the parameter.
importance
Set this parameter to optional if the parameter is optional. Otherwise, do not declare this parameter—it defaults to required.
  • required
  • optional
default
If this parameter is optional, ttdefault/tt is the value that will be used if the parameter is not declared.

wordpress.org.cn /div /noinclude

Return Values

(mixed) 
The value of the setting requested.

Usage

%%%?php get_blog_option( 1, 'blogname' ); ?%%%

The following settings can be fetched using this function:

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]

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.