is_network_only_plugin()

最后更新于:2021-11-27 09:23:05

is_network_only_plugin( string$plugin)

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.

源文件

文件: gc-admin/includes/plugin.php

function is_network_only_plugin( $plugin ) {
	$plugin_data = get_plugin_data( GC_PLUGIN_DIR . '/' . $plugin );
	if ( $plugin_data ) {
		return $plugin_data['Network'];
	}
	return false;
}