BP_Activity_Template::the_activity()

Set up the current activity item inside the loop.

Description

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

See also

Source

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

	public function the_activity() {

		$this->in_the_loop = true;
		$this->activity    = $this->next_activity();

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

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

			/**
			 * Fires if the current activity item is the first in the activity loop.
			 *
			 * @since BuddyPress 1.1.0
			 */
			do_action('activity_loop_start');
		}
	}

Changelog

Changelog
Version Description
BuddyPress 1.0.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.