bb_get_plugin_counts

The BuddyPress bb get plugin counts function.

Description

bb_get_plugin_counts(); 

Usage

  1. if ( !function_exists( 'bb_get_plugin_counts' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-admin/includes/functions.bb-plugin.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bb_get_plugin_counts(); 
  7.  

Defined (1)

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

/bp-forums/bbpress/bb-admin/includes/functions.bb-plugin.php  
  1. function bb_get_plugin_counts() 
  2. $all_plugins = bb_get_plugins( 'all', 'all' ); 
  3. $active_plugins = (array) bb_get_option( 'active_plugins' ); 
  4. $counts = array( 
  5. 'plugin_count_all' => count( $all_plugins ),  
  6. 'plugin_count_active' => count( $active_plugins ),  
  7. 'plugin_count_inactive' => 0,  
  8. 'plugin_count_autoload' => 0 
  9. ); 
  10. foreach ( $all_plugins as $id => $all_plugin ) { 
  11. if ( $all_plugin['autoload'] ) { 
  12. $counts['plugin_count_autoload']++; 
  13. } elseif ( !in_array( $id, $active_plugins ) ) { 
  14. $counts['plugin_count_inactive']++; 
  15. return $counts;