Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: IMPORTANT — Plugin Devs – Read this

Looks like a cleaner way to do it than the old cold I saw DJPaul post a few months back. Is the below incorrect in some way? I’ll probably move over to this way of doing things but we’re literally just about to launch a site with bp-groupwiki and the latest buddypress/wpmu (seems fine in terms of usability):

/* Check that BuddyPress is loaded before Wiki, from DJPaul */

function wiki_load_buddypress() {

if ( function_exists( ‘bp_core_setup_globals’ ) ) {

require_once (‘bp-groupwiki-main.php’);

return true;

}

/* Get the list of active sitewide plugins */

$active_sitewide_plugins = maybe_unserialize( get_site_option( ‘active_sitewide_plugins’ ) );

if ( !isset( $active_sidewide_plugins[‘buddypress/bp-loader.php’] ) )

return false;

if ( isset( $active_sidewide_plugins[‘buddypress/bp-loader.php’] ) && !function_exists( ‘bp_core_setup_globals’ ) ) {

require_once( WP_PLUGIN_DIR . ‘/buddypress/bp-loader.php’ );

require_once (‘bp-groupwiki-main.php’);

return true;

}

return false;

}

add_action( ‘plugins_loaded’, ‘wiki_load_buddypress’, 1 );

Skip to toolbar