首页 WordPress函数大全 get_blog_option()

get_blog_option()

2020-05-01 / 3400阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

get_blog_option( int $id, string $option, mixed $default = false )

Retrieve option value for a given blog id based>

Contents

  • Description
    • Parameters
    • Return
    • Source
    • Changelog
  • Related
    • Uses
    • Used By
  • User Contributed Notes

描述

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.

If the option was serialized then it will be unserialized when it is returned.

参数

$id

(int)
(Required)
A blog ID. Can be null to refer to the current blog.

$option

(string)
(Required)
Name of option to retrieve. Expected to not be SQL-escaped.

$default

(mixed)
(Optional)
Default value to return if the option does not exist.

Default value: false

返回

(mixed) Value set for the option.

大家谈论
    我的见解