bbp_setup_buddypress

Requires and creates the BuddyPress extension, and adds component creation action to bp_init hook.

Description

bbp_setup_buddypress(); 

@see bbp_setup_buddypress_component()


Usage

  1. if ( !function_exists( 'bbp_setup_buddypress' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/core/extend.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bbp_setup_buddypress(); 
  7.  

Defined (1)

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

/includes/core/extend.php  
  1. function bbp_setup_buddypress() { 
  2.  
  3. if ( ! function_exists( 'buddypress' ) ) { 
  4.  
  5. /** 
  6. * Helper for BuddyPress 1.6 and earlier 
  7. * @since bbPress (r4395) 
  8. * @return BuddyPress 
  9. */ 
  10. function buddypress() { 
  11. return isset( $GLOBALS['bp'] ) ? $GLOBALS['bp'] : false; 
  12.  
  13. // Bail if in maintenance mode 
  14. if ( ! buddypress() || buddypress()->maintenance_mode ) 
  15. return; 
  16.  
  17. // Include the BuddyPress Component 
  18. require(bbpress)->includes_dir . 'extend/buddypress/loader.php' ); 
  19.  
  20. // Instantiate BuddyPress for bbPress 
  21. bbpress)->extend->buddypress = new BBP_Forums_Component();