@jbrandsma
4 years, 8 months ago
I am wondering this as well! I would like for people to message any member of the entire platform – not just their friends!
5 years, 2 months ago
Welp, I couldn’t wait so I just spent hours trying to figure this out – with SUCCESS. If anyone stumbles upon this, here is the code I placed in my theme’s function.php file.
function jb_get_bp_user_avatar($avatar, $id_or_email, $size, $default, $alt) { if (is_numeric($id_or_email)) { $id = (int) $id_or_email; $user = get_user_by(‘id’, $id); } elseif (is_object($id_or_email)) { if (!empty($id_or_email->user_id)) { $id = (int) $id_or_email->user_id; $user = get_user_by(‘id’, $id); } } else { $user = get_user_by(’email’, $id_or_email); } if ($user && is_object($user)) { $avatar = bp_core_fetch_avatar(array(‘item_id’ => $user->ID)); } return $avatar; } add_filter(‘get_avatar’, ‘jb_get_bp_user_avatar’, 10000, 5);