PluginProbe
bbPress / 2.2
bbPress v2.2
trunk 2.0 2.0-beta-1 2.0-beta-2b 2.0-beta-3 2.0-beta-3b 2.0-rc-2 2.0-rc-3 2.0-rc-4 2.0-rc-5 2.0.1 2.0.2 2.0.3 2.1 2.1-beta-1 2.1-rc1 2.1-rc2 2.1-rc3 2.1-rc4 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.2.2 All 71 releases
bbpress / includes / core / extend.php

extend.php in bbPress 2.2, at includes/core/extend.php

70 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 /**
39 * Requires and creates the BuddyPress extension, and adds component creation
40 * action to bp_init hook. @see bbp_setup_buddypress_component()
41 *
42 * @since bbPress (r3395)
43 * @return If BuddyPress is not active
44 */
45 function bbp_setup_buddypress() {
46
47 if ( ! function_exists( 'buddypress' ) ) {
48
49 /**
50 * Helper for BuddyPress 1.6 and earlier
51 *
52 * @since bbPress (r4395)
53 * @return BuddyPress
54 */
55 function buddypress() {
56 return isset( $GLOBALS['bp'] ) ? $GLOBALS['bp'] : false;
57 }
58 }
59
60 // Bail if in maintenance mode
61 if ( ! buddypress() || buddypress()->maintenance_mode )
62 return;
63
64 // Include the BuddyPress Component
65 require( bbpress()->includes_dir . 'extend/buddypress/loader.php' );
66
67 // Instantiate BuddyPress for bbPress
68 bbpress()->extend->buddypress = new BBP_Forums_Component();
69 }
70