bp_thread_has_messages( array|string $args = '' )

Initialize the messages template loop for a specific thread.




(array|string) (Optional) Array of arguments. All are optional.

  • 'thread_id'
    (int) ID of the thread whose messages you are displaying. Default: if viewing a thread, the thread ID will be parsed from the URL (bp_action_variable( 0 )).
  • 'order'
    (string) 'ASC' or 'DESC'. Default: 'ASC'.
  • 'update_meta_cache'
    (bool) Whether to pre-fetch metadata for queried message items. Default: true.

Default value: ''


(bool) True if there are messages to display, otherwise false.


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

function bp_thread_has_messages( $args = '' ) {
	global $thread_template;

	$thread_template = bp_get_thread( $args );

	return $thread_template->has_messages();


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.