bbp_get_topic_author_avatar( int $topic_id, int $size = 40 )
Return the author avatar of the topic
Description Description
Parameters Parameters
- $topic_id
-
(Optional) Topic id
- $size
-
(Optional) Avatar size. Defaults to 40
Default value: 40
Return Return
(string) Avatar of the author of the topic
Source Source
File: includes/topics/template.php
function bbp_get_topic_author_avatar( $topic_id = 0, $size = 40 ) {
$author_avatar = '';
$topic_id = bbp_get_topic_id( $topic_id );
if ( ! empty( $topic_id ) ) {
if ( ! bbp_is_topic_anonymous( $topic_id ) ) {
$author_avatar = get_avatar( bbp_get_topic_author_id( $topic_id ), $size );
} else {
$author_avatar = get_avatar( get_post_meta( $topic_id, '_bbp_anonymous_email', true ), $size );
}
}
// Filter & return
return apply_filters( 'bbp_get_topic_author_avatar', $author_avatar, $topic_id, $size );
}
Changelog Changelog
| Version | Description |
|---|---|
| 2.0.0 | Introduced. |