is_network_only_plugin

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

WordPress Version: 5.1

/**
 * 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.
 *
 * @since 3.0.0
 *
 * @param string $plugin Path to the plugin file relative to the plugins directory.
 * @return bool True if plugin is network only, false otherwise.
 */
function is_network_only_plugin($plugin)
{
    $plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin);
    if ($plugin_data) {
        return $plugin_data['Network'];
    }
    return false;
}

WordPress Version: 4.8

/**
 * 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.
 *
 * @since 3.0.0
 *
 * @param string $plugin Path to the main plugin file from plugins directory.
 * @return bool True if plugin is network only, false otherwise.
 */
function is_network_only_plugin($plugin)
{
    $plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin);
    if ($plugin_data) {
        return $plugin_data['Network'];
    }
    return false;
}

WordPress Version: 4.6

/**
 * 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.
 *
 * @since 3.0.0
 *
 * @param string $plugin Plugin to check
 * @return bool True if plugin is network only, false otherwise.
 */
function is_network_only_plugin($plugin)
{
    $plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin);
    if ($plugin_data) {
        return $plugin_data['Network'];
    }
    return false;
}

WordPress Version: 3.7

/**
 * 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 backwards compatibility.
 *
 * @since 3.0.0
 *
 * @param string $plugin Plugin to check
 * @return bool True if plugin is network only, false otherwise.
 */
function is_network_only_plugin($plugin)
{
    $plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin);
    if ($plugin_data) {
        return $plugin_data['Network'];
    }
    return false;
}