Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Class 'BP_Group_Extension' not found Installing Plugin


dpolant
Participant

@dpolant

I think plugins_loaded is already too late to try and load Buddypress if your plugin got loaded before it. do_action( ‘plugins_loaded comes’ ) after all plugins have been loaded, so if there is a missing class dependency, loading BP after that won’t help.

The following code works for me:

function bpgc_load_buddypress() {
//buddypress is loaded
if ( function_exists( 'bp_core_setup_globals' ) )
return false;

// Get the list of active sitewide plugins
$active_sitewide_plugins = maybe_unserialize( get_site_option( 'active_sitewide_plugins' ) );
$bp_activated = $active_sitewide_plugins['buddypress/bp-loader.php'];

//bp is not activated
if ( !$bp_activated ){
return false;
}

//bp is activated but not yet loaded
if ( $bp_activated ) {
return true;
}

return false;
}

//load bp if its not activated
if ( bpgc_load_buddypress() ){
require_once( WP_PLUGIN_DIR . '/buddypress/bp-loader.php' );
}

Add this to the top of your plugin and it ought to load correctly.

Skip to toolbar