As I discussed in a recent post, BP 1.5’s slug setup is a bit different. To ensure full compatibility with all BP 1.5 setups (and specifically, those with hierarchical page structures – such as http://buddypress.org/community/groups), you’ll need to change the way you concatenate links.
The most straightfoward way to do this is by using BP 1.5’s new bp_get_x_root_slug() functions, eg$group_admin_link = bp_get_root_domain() . bp_get_groups_root_slug() . '/' . $this_group_slug . '/admin';
However, using bp_get_groups_root_slug() means that your plugin will not work with earlier versions of BP, which will show a fatal ‘undefined function’ error. If you need to continue to support earlier versions of BP, you might want to think about assembling your links like this:
global $bp;
$group_slug = function_exists( 'bp_get_groups_root_slug' ) ? bp_get_groups_root_slug() : $bp->groups->slug;
$group_admin_link = bp_get_root_domain() . $group_slug . '/' . $this_group_slug . '/admin';
Similarly, the recommended way to check for the current component in BP 1.5 is to use the component-specific functions:
if ( bp_is_groups_component() ) { ...
or, for arbitrary components,
if ( bp_is_current_component( $component_slug_or_root_slug ) ) { ...
However, if you need to retain backward compatibility for the moment, try something like the following:
if ( ( function_exists( 'bp_is_groups_component' ) && bp_is_groups_component() ) || $bp->current_component == $bp->groups->slug ) { ...
I’ll probably be doing this myself with some of my more popular plugins, as a stopgap release until I feel more comfortable dropping backward compatibility with pre-1.5 installations of BuddyPress.