Dynamic Widgets fix for BuddyPress 1.5

Fortunately I had quickly found what was going wrong with the BuddyPress detection process in Dynamic Widgets since BuddyPress 1.5. The fix is included in the development version 1.5b4. This is however a beta version. For people not comfortable with beta versions, having some programming expierence, using Dynamic Widgets 1.4.2 and BuddyPress 1.5, you can also replace the first function in /wp-content/plugins/dynamic-widgets/plugins/bp.php with the function code below.

function dw_get_bp_components() {
	$bp = &$GLOBALS['bp'];
	$DW = &$GLOBALS['DW'];
	
	$components = array();
	
	foreach ( $bp->active_components as $key => $value ) {
		if ( version_compare(BP_VERSION, '1.5', '<') ) {
			$c = &$value;
		} else {
			$c = &$key;
		}
	}
				
	if ( $c == 'groups' ) {
		$components[$c] = ucfirst($c) . ' (only main page)';
		$DW->bp_groups = TRUE;
	} else {
		$components[$c] = ucfirst($c);
	}
	
	asort($components);
	return $components;
}

6 Comments to “Dynamic Widgets fix for BuddyPress 1.5”

  • It seems to be broken in Buddypress 2.0 as well.

    • Hi Mike,
      Where can I find BuddyPress 2.0? I do only see the recently released BuddyPress 1.5.

      • Hi Jacco,
        Sorry I meant 1.5 (think I was looking at the BBpress version).

        Either way I’m a bit unsure as to what is happening and after some prodding it might not be anything to do with your plugin.. After we updated to BuddyPress 1.5 all my dynamic sidebars will not display unless I am logged in, but this seems to be due to my theme’s functions.php file not even getting loaded (so the sidebars don’t get registered).

        • Hmm… Looks like some incompatibility between your theme and BP 1.5. If you want, I can have a look for you. No cure, no pay.

      • Seems to be resolved now..

        Sorry about the confusion, the problem turned out to be with ‘BuddyPress Private Community’ been miss-configured at some point (I didn’t set this up)!

        • Great to read everything is working now. 🙂