• Resolved musoaga

    (@musoaga)


    Is there a way to view custom avatar in the chat view?

    I am using a Plugin for custom avatar, but the BP Better Messages shows the wordpress default avatar, instead of the set avatar with the plugin. Actually the plugin can show the custom avatar with get_avatar() and it works on other sites. How BP Better Messages gets the avatar? Can I override the return value for the avatar?

    Thanks.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter musoaga

    (@musoaga)

    solved by changing code in vendor->buddypress->functions.php the bp_core_fetch_avatar() function

    from

    
    if( $params['html'] === false ){
       return get_avatar_url($params['item_id'], ['size' => 50]);
    } else {
       return get_avatar($params['item_id'], 50);
    }
    

    to

    
    if( $params['html'] === false ){
       return get_wp_user_avatar_src($params['item_id'], ['size' => 50]);
    } else {
       return get_wp_user_avatar($params['item_id'], 50);
    }x
    

    Using the WP User Avatar Plugin

    Plugin Author wordplus

    (@wordplus)

    Hi there!

    Do you using without BuddyPress?

    Thanks!

    Thread Starter musoaga

    (@musoaga)

    Hi, yes without BuddyPress

    Plugin Author wordplus

    (@wordplus)

    so as you can see without BuddyPress it fallbacks to get_avatar, but why dont worked then?

    Thread Starter musoaga

    (@musoaga)

    Actually I realized that I explained the problem a bit wrong. I didn’t used get_avatar() on other site, I used get_avatar_url().

    Maybe get_avatar() don’t work, because the doc page of WP User Avatar Plugin says, you should use get_wp_user_avatar()instead of get_avatar(). I think the problem is the plugin, not your code. My solution is not efficient at all, on your next update it will be overridden ??

    Plugin Author wordplus

    (@wordplus)

    I will probably integrate that to future update.

    Thread Starter musoaga

    (@musoaga)

    Thanks!

    Plugin Author wordplus

    (@wordplus)

    added it to latest version ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Override or Change Avatar’ is closed to new replies.