is_plugin_active_for_network()

最后更新于:2021-11-27 09:52:33

is_plugin_active_for_network( string$plugin)

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.

源文件

文件: gc-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;
}