bbp_get_current_user_avatar( int $size = 40 )

Return avatar of current user

Description

Parameters

$size

(Optional) Size of the avatar. Defaults to 40

Default value: 40

Return

(string) Current user avatar

Source

File: bp-forums/users/template.php

	function bbp_get_current_user_avatar( $size = 40 ) {

		$user = bbp_get_current_user_id();
		if ( empty( $user ) )
			$user = bbp_get_current_anonymous_user_data( 'email' );

		$avatar = get_avatar( $user, $size );

		return apply_filters( 'bbp_get_current_user_avatar', $avatar, $size );
	}

Changelog

Changelog
Version Description
bbPress (r2574) 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.