add_site_option()向wp_option表添加选项/值对(多站点)

目录

描述

Essentially the same as add_option() but works network wide when using WP Multisite.

The only major difference is that on multisite site-wide options will not autoload and on a single site the option will autoload. Unlike when using add_option() on a single site, the feature cannot be overridden.

add_site_option() 描述

用法

<?php add_site_option$option$value ); ?>

add_site_option() 用法

参数

$option

(string) (必填) The name of the option to add.

默认值: None

$value

(mixed) (必填) The value for the option.

默认值: None

add_site_option() 参数

返回值

(boolean

Whether the option was added.

add_site_option() 返回值

历史

  • 3.3.0 - The behavior of the function was changed so that existing options would not be updated.
  • 添加于 版本 2.8.0

add_site_option() 历史

源文件

add_site_option() 函数的代码位于 wp-includes/option.php.

add_site_option() 源文件

相关