bp_get_message_thread_avatar( array|string $args = '' )

Return the avatar for the last sender in the current message thread.


Description Description

See also See also


Top ↑

Parameters Parameters

$args

(array|string) (Optional) Arguments are listed here with an explanation of their defaults. For more information about the arguments, see bp_core_fetch_avatar().

  • 'type'
    (string) Default: 'thumb'.
  • 'width'
    (int|bool) Default: false.
  • 'height'
    (int|bool) Default: false.
  • 'class'
    (string) Default: 'avatar'.
  • 'id'
    (string|bool) Default: false.
  • 'alt'
    (string) Default: 'Profile picture of [display name]'.

Default value: ''


Top ↑

Return Return

(string) User avatar string.


Top ↑

Source Source

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

	function bp_get_message_thread_avatar( $args = '' ) {
		global $messages_template;

		$fullname = bp_core_get_user_displayname( $messages_template->thread->last_sender_id );
		$alt      = sprintf( __( 'Profile picture of %s', 'buddypress' ), $fullname );

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

		/**
		 * Filters the avatar for the last sender in the current message thread.
		 *
		 * @since 1.0.0
		 * @since 2.6.0 Added the `$r` parameter.
		 *
		 * @param string $value User avatar string.
		 * @param array  $r     Array of parsed arguments.
		 */
		return apply_filters( 'bp_get_message_thread_avatar', bp_core_fetch_avatar( array(
			'item_id' => $messages_template->thread->last_sender_id,
			'type'    => $r['type'],
			'alt'     => $r['alt'],
			'css_id'  => $r['id'],
			'class'   => $r['class'],
			'width'   => $r['width'],
			'height'  => $r['height'],
		) ), $r );
	}


Top ↑

User Contributed Notes User Contributed Notes

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