wp_get_active_network_plugins

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

WordPress Version: 6.3

/**
 * Returns array of network plugin files to be included in global scope.
 *
 * The default directory is wp-content/plugins. To change the default directory
 * manually, define `WP_PLUGIN_DIR` and `WP_PLUGIN_URL` in `wp-config.php`.
 *
 * @access private
 * @since 3.1.0
 *
 * @return string[] Array of absolute paths to files to include.
 */
function wp_get_active_network_plugins()
{
    $active_plugins = (array) get_site_option('active_sitewide_plugins', array());
    if (empty($active_plugins)) {
        return array();
    }
    $plugins = array();
    $active_plugins = array_keys($active_plugins);
    sort($active_plugins);
    foreach ($active_plugins as $plugin) {
        if (!validate_file($plugin) && str_ends_with($plugin, '.php') && file_exists(WP_PLUGIN_DIR . '/' . $plugin)) {
            $plugins[] = WP_PLUGIN_DIR . '/' . $plugin;
        }
    }
    return $plugins;
}

WordPress Version: 5.5

/**
 * Returns array of network plugin files to be included in global scope.
 *
 * The default directory is wp-content/plugins. To change the default directory
 * manually, define `WP_PLUGIN_DIR` and `WP_PLUGIN_URL` in `wp-config.php`.
 *
 * @access private
 * @since 3.1.0
 *
 * @return string[] Array of absolute paths to files to include.
 */
function wp_get_active_network_plugins()
{
    $active_plugins = (array) get_site_option('active_sitewide_plugins', array());
    if (empty($active_plugins)) {
        return array();
    }
    $plugins = array();
    $active_plugins = array_keys($active_plugins);
    sort($active_plugins);
    foreach ($active_plugins as $plugin) {
        if (!validate_file($plugin) && '.php' === substr($plugin, -4) && file_exists(WP_PLUGIN_DIR . '/' . $plugin)) {
            $plugins[] = WP_PLUGIN_DIR . '/' . $plugin;
        }
    }
    return $plugins;
}

WordPress Version: 5.4

/**
 * Returns array of network plugin files to be included in global scope.
 *
 * The default directory is wp-content/plugins. To change the default directory
 * manually, define `WP_PLUGIN_DIR` and `WP_PLUGIN_URL` in `wp-config.php`.
 *
 * @access private
 * @since 3.1.0
 *
 * @return string[] Array of absolute paths to files to include.
 */
function wp_get_active_network_plugins()
{
    $active_plugins = (array) get_site_option('active_sitewide_plugins', array());
    if (empty($active_plugins)) {
        return array();
    }
    $plugins = array();
    $active_plugins = array_keys($active_plugins);
    sort($active_plugins);
    foreach ($active_plugins as $plugin) {
        if (!validate_file($plugin) && '.php' == substr($plugin, -4) && file_exists(WP_PLUGIN_DIR . '/' . $plugin)) {
            $plugins[] = WP_PLUGIN_DIR . '/' . $plugin;
        }
    }
    return $plugins;
}

WordPress Version: 4.1

/**
 * Returns array of network plugin files to be included in global scope.
 *
 * The default directory is wp-content/plugins. To change the default directory
 * manually, define `WP_PLUGIN_DIR` and `WP_PLUGIN_URL` in `wp-config.php`.
 *
 * @access private
 * @since 3.1.0
 *
 * @return array Files to include.
 */
function wp_get_active_network_plugins()
{
    $active_plugins = (array) get_site_option('active_sitewide_plugins', array());
    if (empty($active_plugins)) {
        return array();
    }
    $plugins = array();
    $active_plugins = array_keys($active_plugins);
    sort($active_plugins);
    foreach ($active_plugins as $plugin) {
        if (!validate_file($plugin) && '.php' == substr($plugin, -4) && file_exists(WP_PLUGIN_DIR . '/' . $plugin)) {
            $plugins[] = WP_PLUGIN_DIR . '/' . $plugin;
        }
    }
    return $plugins;
}

WordPress Version: 3.7

/**
 * Returns array of network plugin files to be included in global scope.
 *
 * The default directory is wp-content/plugins. To change the default directory
 * manually, define <code>WP_PLUGIN_DIR</code> and <code>WP_PLUGIN_URL</code>
 * in wp-config.php.
 *
 * @access private
 * @since 3.1.0
 * @return array Files to include
 */
function wp_get_active_network_plugins()
{
    $active_plugins = (array) get_site_option('active_sitewide_plugins', array());
    if (empty($active_plugins)) {
        return array();
    }
    $plugins = array();
    $active_plugins = array_keys($active_plugins);
    sort($active_plugins);
    foreach ($active_plugins as $plugin) {
        if (!validate_file($plugin) && '.php' == substr($plugin, -4) && file_exists(WP_PLUGIN_DIR . '/' . $plugin)) {
            $plugins[] = WP_PLUGIN_DIR . '/' . $plugin;
        }
    }
    return $plugins;
}