How to print out global $bp variable to screen

Platform: BuddyPress

CHALLENGE:

Working with BuddyPress can be one interesting adventure. When diving into this jungle I prefer to have all of the tools I can gather before hand. One of the handiest tools I have found is this little snippet that prints the $bp global to the screen so the developer can read first hand what is in the arrays.

SOLUTION:

global $bp;
foreach ( (array)$bp as $key => $value ) {
    echo '<pre>';
        echo '<code><strong></code><strong>' . $key . '</strong><code></strong><br></code>';
        print_r( $value );
<code>    </code>echo '<code></pre></code>';
}

Posted in ,