bbp_get_reply_author_avatar( int $reply_id, int $size = 40 )

Return the author avatar of the reply

Description

Parameters

$reply_id

(Optional) Reply id

$size

(Optional) Size of the avatar. Defaults to 40

Default value: 40

Return

(string) Avatar of author of the reply

Source

File: bp-forums/replies/template.php

1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
function bbp_get_reply_author_avatar( $reply_id = 0, $size = 40 ) {
    $reply_id = bbp_get_reply_id( $reply_id );
    if ( !empty( $reply_id ) ) {
        // Check for anonymous user
        if ( !bbp_is_reply_anonymous( $reply_id ) ) {
            $author_avatar = get_avatar( bbp_get_reply_author_id( $reply_id ), $size );
        } else {
            $author_avatar = get_avatar( get_post_meta( $reply_id, '_bbp_anonymous_email', true ), $size );
        }
    } else {
        $author_avatar = '';
    }
 
    return apply_filters( 'bbp_get_reply_author_avatar', $author_avatar, $reply_id, $size );
}

Changelog

Changelog
Version Description
bbPress (r2667) Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.