is_plugin_active_for_network
Check whether the plugin is active for the entire network.
Description
is_plugin_active_for_network( (string) $plugin );
Only plugins installed in the plugins/ folder can be active.
Plugins in the mu-plugins/ folder can't be activated, so this function will return false for those plugins.
Parameters (1)
- 0. $plugin (string)
- Base plugin path from plugins directory.
Usage
if ( !function_exists( 'is_plugin_active_for_network' ) ) { require_once ABSPATH . '/wp-admin/includes/plugin.php'; } // Base plugin path from plugins directory. $plugin = ''; // NOTICE! Understand what this does before running. $result = is_plugin_active_for_network($plugin);
Defined (1)
The function is defined in the following location(s).
- /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;
- }