Reply To: Changing avatar images and profile links
I think I have this working now by including get_activity_user_id:
function my_default_avatar_url() {
$url = get_site_url();
$user_id = bp_get_member_user_id();
if (empty($user_id)) {
$user_id = bp_get_activity_user_id();
}
$profile_image = get_the_author_meta( my_avatar, $user_id );
if (empty($profile_image)) {
$profile_image = '' . $url . '/wp-content/uploads/avatars/avatar.png';
}
return $profile_image;
}
add_filter( 'bp_core_default_avatar_user', 'my_default_avatar_url' );