BP_Messages_Thread_Template::messages()

Whether there are messages left in the loop to iterate over.


Description Description

This method is used by bp_thread_messages() as part of the while loop that controls iteration inside the messages loop, eg: while ( bp_thread_messages() ) { …

See also See also


Top ↑

Return Return

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


Top ↑

Source Source

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

	public function messages() {
		if ( ( $this->current_message + 1 ) < $this->message_count ) {
			return true;
		} elseif ( ( $this->current_message + 1 ) === $this->message_count ) {

			/**
			 * Fires when at the end of messages to iterate over.
			 *
			 * @since 1.1.0
			 */
			do_action( 'thread_loop_end' );
			// Do some cleaning up after the loop.
			$this->rewind_messages();
		}

		$this->in_the_loop = false;
		return false;
	}

Top ↑

User Contributed Notes User Contributed Notes

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