/includes/core/extend.php

  1. <?php 
  2.  
  3. /** 
  4. * bbPress Extentions 
  5. * 
  6. * There's a world of really cool plugins out there, and bbPress comes with 
  7. * support for some of the most popular ones. 
  8. * 
  9. * @package bbPress 
  10. * @subpackage Extend 
  11. */ 
  12.  
  13. // Exit if accessed directly 
  14. if ( !defined( 'ABSPATH' ) ) exit; 
  15.  
  16. /** 
  17. * Loads Akismet inside the bbPress global class 
  18. * 
  19. * @since bbPress (r3277) 
  20. * 
  21. * @return If bbPress is not active 
  22. */ 
  23. function bbp_setup_akismet() { 
  24.  
  25. // Bail if no akismet 
  26. if ( !defined( 'AKISMET_VERSION' ) ) return; 
  27.  
  28. // Bail if Akismet is turned off 
  29. if ( !bbp_is_akismet_active() ) return; 
  30.  
  31. // Include the Akismet Component 
  32. require( bbpress()->includes_dir . 'extend/akismet.php' ); 
  33.  
  34. // Instantiate Akismet for bbPress 
  35. bbpress()->extend->akismet = new BBP_Akismet(); 
  36.  
  37. /** 
  38. * Requires and creates the BuddyPress extension, and adds component creation 
  39. * action to bp_init hook. @see bbp_setup_buddypress_component() 
  40. * 
  41. * @since bbPress (r3395) 
  42. * @return If BuddyPress is not active 
  43. */ 
  44. function bbp_setup_buddypress() { 
  45.  
  46. if ( ! function_exists( 'buddypress' ) ) { 
  47.  
  48. /** 
  49. * Helper for BuddyPress 1.6 and earlier 
  50. * 
  51. * @since bbPress (r4395) 
  52. * @return BuddyPress 
  53. */ 
  54. function buddypress() { 
  55. return isset( $GLOBALS['bp'] ) ? $GLOBALS['bp'] : false; 
  56.  
  57. // Bail if in maintenance mode 
  58. if ( ! buddypress() || buddypress()->maintenance_mode ) 
  59. return; 
  60.  
  61. // Include the BuddyPress Component 
  62. require( bbpress()->includes_dir . 'extend/buddypress/loader.php' ); 
  63.  
  64. // Instantiate BuddyPress for bbPress 
  65. bbpress()->extend->buddypress = new BBP_Forums_Component(); 
.