WordPress开发者和主题制作者的搜索引擎



is_network_only_plugin ›

Since3.0.0
已弃用n/a
is_network_only_plugin ( $plugin )
参数:
  • (string) $plugin Path to the plugin file relative to the plugins directory.
    Required: Yes
返回:
  • (bool) True if plugin is network only, false otherwise.
定义在:
文档:

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.

Checks for "Site Wide Only: true" for backward compatibility.



源码

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