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

  1. if ( !function_exists( 'wp_get_active_network_plugins' ) ) { 
  2. require_once ABSPATH . WPINC . '/ms-load.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wp_get_active_network_plugins(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/ms-load.php  
  1. function wp_get_active_network_plugins() { 
  2. $active_plugins = (array) get_site_option( 'active_sitewide_plugins', array() ); 
  3. if ( empty( $active_plugins ) ) 
  4. return array(); 
  5.  
  6. $plugins = array(); 
  7. $active_plugins = array_keys( $active_plugins ); 
  8. sort( $active_plugins ); 
  9.  
  10. foreach ( $active_plugins as $plugin ) { 
  11. if ( ! validate_file( $plugin ) // $plugin must validate as file 
  12. && '.php' == substr( $plugin, -4 ) // $plugin must end with '.php' 
  13. && file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist 
  14. $plugins[] = WP_PLUGIN_DIR . '/' . $plugin; 
  15. return $plugins;