is_network_only_plugin

Checks for "Network: true" in the plugin header to see if this should be activated only as a network wide plugin.

Description

is_network_only_plugin( (string) $plugin ); 

The plugin would also work when Multisite is not enabled.

Checks for Site Wide Only: true for backward compatibility.

Parameters (1)

0. $plugin (string)
Plugin to check

Usage

  1. if ( !function_exists( 'is_network_only_plugin' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/plugin.php'; 
  3.  
  4. // Plugin to check 
  5. $plugin = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = is_network_only_plugin($plugin); 
  9.  

Defined (1)

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

/wp-admin/includes/plugin.php  
  1. function is_network_only_plugin( $plugin ) { 
  2. $plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ); 
  3. if ( $plugin_data ) 
  4. return $plugin_data['Network']; 
  5. return false;