BP_Messages_Thread::get_recipient_links( array $recipients )

Returns a string containing all the message recipient userlinks.


Description Description

String is comma-delimited.

If a message thread has more than four users, the returned string is simply "X Recipients" where "X" is the number of recipients in the message thread.


Parameters Parameters

$recipients

(Required) Array containing the message recipients (array of objects).


Top ↑

Return Return

(string) $value String of message recipent userlinks.


Top ↑

Source Source

File: bp-messages/classes/class-bp-messages-thread.php

	public static function get_recipient_links( $recipients ) {

		if ( count( $recipients ) >= 5 ) {
			return sprintf( __( '%s Recipients', 'buddypress' ), number_format_i18n( count( $recipients ) ) );
		}

		$recipient_links = array();

		foreach ( (array) $recipients as $recipient ) {
			$recipient_link = bp_core_get_userlink( $recipient->user_id );

			if ( empty( $recipient_link ) ) {
				$recipient_link = __( 'Deleted User', 'buddypress' );
			}

			$recipient_links[] = $recipient_link;
		}

		return implode( ', ', (array) $recipient_links );
	}

Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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