is_main_network()
is_main_network( int $network_id = null )
确定网络是否是多站点安装的主网络。
Determine whether a network is the main network of the Multisite installation.
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$network_id | (int) | 可选 | 要测试的网络ID。默认为当前网络。 |
返回(Return)
(bool)如果$network_id是主网络,或者如果不运行多站点,则为True。
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
3.7.0 | wp-includes/functions.php:5497 | 4 | 3 |
is_main_network() 为WP2原创文章,链接:https://www.wp2.cn/functions/is_main_network/