BP_Document_Template::the_document()

Set up the current document item inside the loop.

Description

Used by bp_the_document() to set up the current document item data while looping, so that template tags used during that iteration make reference to the current document item.

See also

Source

File: bp-document/classes/class-bp-document-template.php

	public function the_document() {

		$this->in_the_loop = true;
		$this->document    = $this->next_document();

		if ( is_array( $this->document ) ) {
			$this->document = (object) $this->document;
		}

		// Loop has just started.
		if ( $this->current_document == 0 ) {

			/**
			 * Fires if the current document item is the first in the activity loop.
			 *
			 * @since BuddyBoss 1.4.0
			 */
			do_action( 'document_loop_start' );
		}
	}

Changelog

Changelog
Version Description
BuddyBoss 1.4.0 Introduced.

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.