bp_get_message_thread_total_and_unread_count( int|bool $thread_id = false )

Get markup for the current thread’s total and unread count.


Parameters Parameters

$thread_id

(int|bool) (Optional) ID of the thread. Default: current thread ID.

Default value: false


Top ↑

Return Return

(string) Markup displaying the total and unread count for the thread.


Source Source

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

	function bp_get_message_thread_total_and_unread_count( $thread_id = false ) {
		if ( false === $thread_id ) {
			$thread_id = bp_get_message_thread_id();
		}

		$total  = bp_get_message_thread_total_count( $thread_id );
		$unread = bp_get_message_thread_unread_count( $thread_id );

		return sprintf(
			/* translators: 1: total number, 2: accessibility text: number of unread messages */
			'<span class="thread-count">(%1$s)</span> <span class="bp-screen-reader-text">%2$s</span>',
			number_format_i18n( $total ),
			/* translators: %d: number of unread messages */
			sprintf( _n( '%d unread', '%d unread', $unread, 'buddypress' ), number_format_i18n( $unread ) )
		);
	}


Top ↑

User Contributed Notes User Contributed Notes

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