is_plugin_active_for_network

The timeline below displays how wordpress function is_plugin_active_for_network has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.1

/**
 * Determines whether the plugin is active for the entire network.
 *
 * 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.
 *
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
 * Conditional Tags} article in the Theme Developer Handbook.
 *
 * @since 3.0.0
 *
 * @param string $plugin Path to the plugin file relative to the plugins directory.
 * @return bool True if active for the network, otherwise false.
 */
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;
}

WordPress Version: 5.0

/**
 * Determines whether the plugin is active for the entire network.
 *
 * 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.
 * 
 * For more information on this and similar theme functions, check out
 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ 
 * Conditional Tags} article in the Theme Developer Handbook.
 * 
 * @since 3.0.0
 *
 * @param string $plugin Path to the main plugin file from plugins directory.
 * @return bool True if active for the network, otherwise false.
 */
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;
}

WordPress Version: 4.8

/**
 * Check whether the plugin is active for the entire network.
 *
 * 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.
 *
 * @since 3.0.0
 *
 * @param string $plugin Path to the main plugin file from plugins directory.
 * @return bool True, if active for the network, otherwise false.
 */
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;
}

WordPress Version: 4.5

/**
 * Check whether the plugin is active for the entire network.
 *
 * 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.
 *
 * @since 3.0.0
 *
 * @param string $plugin Base plugin path from plugins directory.
 * @return bool True, if active for the network, otherwise false.
 */
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;
}

WordPress Version: 3.7

/**
 * Check whether the plugin is active for the entire network.
 *
 * @since 3.0.0
 *
 * @param string $plugin Base plugin path from plugins directory.
 * @return bool True, if active for the network, otherwise false.
 */
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;
}