bp_get_message_thread_avatar

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

Description

(string) bp_get_message_thread_avatar( (string) $args = '' ); 

Returns (string)

User avatar string.

Parameters (1)

0. $args — Optional. (string) => ''
The args.

Options

    ;        


    Usage

    1. if ( !function_exists( 'bp_get_message_thread_avatar' ) ) { 
    2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-messages/bp-messages-template.php'; 
    3.  
    4. // The args. 
    5. $args = ''; 
    6.  
    7. // NOTICE! Understand what this does before running. 
    8. $result = bp_get_message_thread_avatar($args); 
    9.  

    Defined (1)

    The function is defined in the following location(s).

    /bp-messages/bp-messages-template.php  
    1. function bp_get_message_thread_avatar( $args = '' ) { 
    2. global $messages_template; 
    3.  
    4. $fullname = bp_core_get_user_displayname( $messages_template->thread->last_sender_id ); 
    5. $alt = sprintf( __( 'Profile picture of %s', buddypress ), $fullname ); 
    6.  
    7. $r = bp_parse_args( $args, array( 
    8. 'type' => 'thumb',  
    9. 'width' => false,  
    10. 'height' => false,  
    11. 'class' => 'avatar',  
    12. 'id' => false,  
    13. 'alt' => $alt 
    14. ) ); 
    15.  
    16. /** 
    17. * Filters the avatar for the last sender in the current message thread. 
    18. * @since 1.0.0 
    19. * @since 2.6.0 Added the `$r` parameter. 
    20. * @param string $value User avatar string. 
    21. * @param array $r Array of parsed arguments. 
    22. */ 
    23. 'item_id' => $messages_template->thread->last_sender_id,  
    24. 'type' => $r['type'],  
    25. 'alt' => $r['alt'],  
    26. 'css_id' => $r['id'],  
    27. 'class' => $r['class'],  
    28. 'width' => $r['width'],  
    29. 'height' => $r['height'],  
    30. ) ), $r );