函数原型
is_plugin_active_for_network( string $plugin ): bool
函数描述
Determines whether the plugin is active for the entire network.
是否弃用
未弃用
函数参数
-
$plugin
string
Required - Path to the plugin file relative to the plugins directory.
函数返回值
bool True if active for the network, otherwise false.
函数位置
File: wp-admin/includes/plugin.php.
函数源码
function is_plugin_active_for_network( $plugin ) {
if ( ! is_multisite() ) {
return false;
}
$plugins = get_site_option( 'active_sitewide_plugins' );
if ( isset( $plugins[ $plugin ] ) ) {
return true;
}
return false;
}
源码链接
变更日志
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |

