Skip to content

Commit

Permalink
Ensure that BuddyPress is running before loading frontend functions.
Browse files Browse the repository at this point in the history
The `CBox_Frontend` bootstrap involves a call to `bp_get_option()`, which
requires BuddyPress. If BP is disabled - as during the installation process -
it could result in fatal errors on the site's frontend.
  • Loading branch information
boonebgorges committed Apr 22, 2015
1 parent d417d4c commit 13f523f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions includes/frontend.php
Expand Up @@ -22,6 +22,11 @@ class CBox_Frontend {
* Constructor.
*/
public function __construct() {
// Sanity check: ensure that BuddyPress is running.
if ( ! function_exists( 'buddypress' ) ) {
return;
}

// setup globals
$this->setup_globals();

Expand Down

0 comments on commit 13f523f

Please sign in to comment.