Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)

  • jbrandsma
    Participant

    @jbrandsma

    I am wondering this as well! I would like for people to message any member of the entire platform – not just their friends!


    jbrandsma
    Participant

    @jbrandsma

    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);

Viewing 2 replies - 1 through 2 (of 2 total)
Skip to toolbar