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


Top ↑

Return Return

(string) Avatar of the author of the topic


Top ↑

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

Top ↑

Changelog Changelog

Changelog
Version Description
2.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.