Forum Replies Created
-
php while ( bp_groups() ) : bp_the_group(); if(bp_get_group_name() != “Name of your Group” && bp_get_group_name() != “Name of your Group2” && bp_get_group_name() != “Name of your Group3”) :
Depending on how many you want to exclude you may be better with a switch statement (http://php.net/manual/en/control-structures.switch.php). Have a look further at if statements http://php.net/manual/en/control-structures.if.php
Ah, That’s brilliant. I totally forgot about those settings.
Thank you Shawn.
For anyone who may find this,and is looking to do what I did here is the code:
`function bbg_turn_secondary_avatars_to_links( $avatar ) {
global $activities_template;switch ( $activities_template->activity->component ) {
case ‘groups’ :
$item_id = $activities_template->activity->item_id;
$group = groups_get_group( array( ‘group_id’ => $item_id ) );
$url = apply_filters( ‘bp_get_group_permalink’, trailingslashit( bp_get_root_domain() . ‘/’ . bp_get_groups_root_slug() . ‘/’ . $group->slug . ‘/’ ) );
break;
case ‘blogs’ :
break;
case ‘friends’ :
$item_id = $activities_template->activity->secondary_item_id;
$url = bp_core_get_user_domain($item_id);
break;
default :
break;}
if ( !empty( $url ) ) {
$avatar = ‘‘ . $avatar . ‘‘;
}
return $avatar;
}
add_filter( ‘bp_get_activity_secondary_avatar’, ‘bbg_turn_secondary_avatars_to_links’ );`Thanks Boone, I’ll have a look at your idea.
FYI, I’ve submitted a ticket. https://buddypress.trac.wordpress.org/ticket/4436