函数原型
is_network_only_plugin( string $plugin ): bool
函数描述
Checks for “Network: true” in the plugin header to see if this should be activated only as a network wide plugin. The plugin would also work when Multisite is not enabled.
是否弃用
未弃用
函数参数
-
$plugin
string
Required - Path to the plugin file relative to the plugins directory.
函数返回值
bool True if plugin is network only, false otherwise.
函数位置
File: wp-admin/includes/plugin.php.
函数源码
function is_network_only_plugin( $plugin ) {
$plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );
if ( $plugin_data ) {
return $plugin_data['Network'];
}
return false;
}
源码链接
变更日志
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |

