Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: MU 2.9.1 Upgrade … What broke?


dpolant
Participant

@dpolant

Try putting something like this at the beginning of the plugin: (not tested for all cases but worked for me). What screws up groups API is when BP gets loaded after the plugin and your plugin can’t find the class its supposed to extend. I have no idea why wpmu 2.9.1 brings out this issue.

function 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 activated and not loaded
if ( load_buddypress() ){
require_once( WP_PLUGIN_DIR . '/buddypress/bp-loader.php' );
}

This made it work one of my plugins. It basically forces BP to load at the beginning of your plugin. And something in WP prevents it from loading twice if it does this.

Skip to toolbar