bp_message_get_recipient_tabs()

Output the markup for the message recipient tabs.

Description

Source

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

1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
function bp_message_get_recipient_tabs() {
    $recipients = explode( ' ', bp_get_message_get_recipient_usernames() );
 
    foreach ( $recipients as $recipient ) {
 
        $user_id = bp_is_username_compatibility_mode()
            ? bp_core_get_userid( $recipient )
            : bp_core_get_userid_from_nicename( $recipient );
 
        if ( ! empty( $user_id ) ) : ?>
 
            <li id="un-<?php echo esc_attr( $recipient ); ?>" class="friend-tab">
                <span><?php
                    echo bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'width' => 15, 'height' => 15 ) );
                    echo bp_core_get_userlink( $user_id );
                ?></span>
            </li>
 
        <?php endif;
    }
}

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.