bb_get_plugins_callback

The BuddyPress bb get plugins callback function.

Description

bb_get_plugins_callback( $type, $path, (string) $filename ); 

Parameters (3)

0. $type
The type.
1. $path
The path.
2. $filename (string)
The filename.

Usage

  1. if ( !function_exists( 'bb_get_plugins_callback' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-admin/includes/functions.bb-plugin.php'; 
  3.  
  4. // The type. 
  5. $type = null; 
  6.  
  7. // The path. 
  8. $path = null; 
  9.  
  10. // The filename. 
  11. $filename = ''; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = bb_get_plugins_callback($type, $path, $filename); 
  15.  

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_plugins_callback( $type = 'normal', $path, $filename ) 
  2. if ( '.php' != substr( $filename, -4 ) ) { 
  3. return false; 
  4.  
  5. $data = array( 'autoload' => 0 ); 
  6.  
  7. if ( $has_underscore = '_' === substr( $filename, 0, 1 ) ) { 
  8. switch ( $type ) { 
  9. case 'all': 
  10. case 'autoload': 
  11. $data['autoload'] = 1; 
  12. break; 
  13. case 'normal': 
  14. default: 
  15. return false; 
  16. break; 
  17. } elseif ( 'autoload' === $type ) { 
  18. return false; 
  19.  
  20. if ( $_data = bb_get_plugin_data( $path ) ) { 
  21. return array_merge( $_data , $data ); 
  22.  
  23. return false;