bp_get_the_thread_message_sender_avatar_thumb( array|string $args = '' )

Get the avatar for the current message sender.




(array|string) (Optional) Array of arguments. See bp_core_fetch_avatar() for more complete details. All arguments are optional.

  • 'type'
    (string) Avatar type. Default: 'thumb'.
  • 'width'
    (int) Avatar width. Default: default for your $type.
  • 'height'
    (int) Avatar height. Default: default for your $type.

Default value: ''


(string) <img> tag containing the avatar.


File: bp-messages/bp-messages-template.php

	function bp_get_the_thread_message_sender_avatar_thumb( $args = '' ) {
		global $thread_template;

		$r = bp_parse_args( $args, array(
			'type'   => 'thumb',
			'width'  => false,
			'height' => false,
		) );

		 * Filters the avatar for the current message sender.
		 * @since BuddyPress 1.1.0
		 * @since BuddyPress 2.6.0 Added the `$r` parameter.
		 * @param string $value <img> tag containing the avatar value.
		 * @param array  $r     Array of parsed arguments.
		return apply_filters( 'bp_get_the_thread_message_sender_avatar_thumb', bp_core_fetch_avatar( array(
			'item_id' => $thread_template->message->sender_id,
			'type'    => $r['type'],
			'width'   => $r['width'],
			'height'  => $r['height'],
			'alt'     => bp_core_get_user_displayname( $thread_template->message->sender_id )
		) ), $r );


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.