wp_get_active_network_plugins
Returns array of network plugin files to be included in global scope.
Description
(array) wp_get_active_network_plugins();
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.
Returns (array)
Files to include.
Usage
if ( !function_exists( 'wp_get_active_network_plugins' ) ) { require_once ABSPATH . WPINC . '/ms-load.php'; } // NOTICE! Understand what this does before running. $result = wp_get_active_network_plugins();
Defined (1)
The function is defined in the following location(s).
- /wp-includes/ms-load.php
- 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 ) // $plugin must validate as file
- && '.php' == substr( $plugin, -4 ) // $plugin must end with '.php'
- && file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist
- )
- $plugins[] = WP_PLUGIN_DIR . '/' . $plugin;
- }
- return $plugins;
- }