WordPress函数文档get_blog_option()

获取wp_option表中的选项记录(多站点) 描述 Retrieve option value based …

获取wp_option表中的选项记录(多站点)

描述

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.

用法

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

参数

$blog_id

(integer) (必填) is the id of the blog.

默认值: None

$setting

(string) (必填) Name of option to retrieve. Should already be SQL-escaped.

默认值: None

$default

(string) (可选) Default value returned if option not found.

默认值: false

返回值

(mixed

Value set for the option.

  • 原文:http://codex.wordpress.org/Function_Reference/get_blog_option
类别:WordPress函数文档

本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。

评论 (0)COMMENT