Skip to:
Content
Pages
Categories
Search
Top
Bottom
Codex HomeDeveloper Resources → The $bp Global

The $bp Global

The $bp global is deprecated. Instead, you should use the following, inside a function:

$bp=buddypress();

Now the $bp, contains all of the variables and configuration settings that BuddyPress needs to use throughout an installation. As a developer you may find a good first step is to use the function below to render out the contents. You’ll then be able to look over everything and get a glimpse into how things work behind the scenes.

Add this to the top of ‘bp-core.php’ and you’ll be able to take a good look at it:

1
2
3
4
5
6
7
8
9
10
11
12
function bp_dump() {
    global $bp;
    foreach ( (array)$bp as $key => $value ) {
        echo '<pre>';
        echo '<strong>' . $key . ': </strong><br />';
        print_r( $value );
        echo '</pre>';
    }
    die;
}
add_action( 'wp', 'bp_dump' );

Here’s an description of each setting:

Skip to toolbar