bp_get_the_thread_message_sender_avatar_thumb( array|string $args = '' )

Get the avatar for the current message sender.

Description

Parameters

$args

(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: ''

Return

(string) <img> tag containing the avatar.

Source

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

1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
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 );
}

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.