| 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 |
defined( 'ABSPATH' ) || exit; |
| 15 |
|
| 16 |
/** |
| 17 |
* Loads Akismet inside the bbPress global class |
| 18 |
* |
| 19 |
* @since 2.0.0 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' ) ) { |
| 27 |
return; |
| 28 |
} |
| 29 |
|
| 30 |
// Bail if Akismet is turned off |
| 31 |
if ( ! bbp_is_akismet_active() ) { |
| 32 |
return; |
| 33 |
} |
| 34 |
|
| 35 |
// Include the Akismet Component |
| 36 |
require_once bbpress()->includes_dir . 'extend/akismet.php'; |
| 37 |
|
| 38 |
// Instantiate Akismet for bbPress |
| 39 |
bbpress()->extend->akismet = new BBP_Akismet(); |
| 40 |
} |
| 41 |
|
| 42 |
/** |
| 43 |
* Requires and creates the BuddyPress extension, and adds component creation |
| 44 |
* action to bp_init hook. @see bbp_setup_buddypress_component() |
| 45 |
* |
| 46 |
* @since 2.0.0 bbPress (r3395) |
| 47 |
* |
| 48 |
* @return If BuddyPress is not active |
| 49 |
*/ |
| 50 |
function bbp_setup_buddypress() { |
| 51 |
|
| 52 |
if ( ! function_exists( 'buddypress' ) ) { |
| 53 |
|
| 54 |
/** |
| 55 |
* Helper for BuddyPress 1.6 and earlier |
| 56 |
* |
| 57 |
* @since 2.2.0 bbPress (r4395) |
| 58 |
* |
| 59 |
* @return BuddyPress |
| 60 |
*/ |
| 61 |
function buddypress() { |
| 62 |
return isset( $GLOBALS['bp'] ) ? $GLOBALS['bp'] : false; |
| 63 |
} |
| 64 |
} |
| 65 |
|
| 66 |
// Bail if in maintenance mode |
| 67 |
if ( ! buddypress() || buddypress()->maintenance_mode ) { |
| 68 |
return; |
| 69 |
} |
| 70 |
|
| 71 |
// Include the BuddyPress Component |
| 72 |
require_once bbpress()->includes_dir . 'extend/buddypress/loader.php'; |
| 73 |
|
| 74 |
// Instantiate BuddyPress for bbPress |
| 75 |
bbpress()->extend->buddypress = new BBP_Forums_Component(); |
| 76 |
} |
| 77 |
|