BP_Activity_Activity::get_sitewide_items_for_feed( int $limit = 35 )

Get sitewide activity items for use in an RSS feed.


Parameters Parameters

$limit

(int) (Optional) Number of items to fetch. Default: 35.

Default value: 35


Top ↑

Return Return

(array) $activity_feed List of activity items, with RSS data added.


Source Source

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

	public static function get_sitewide_items_for_feed( $limit = 35 ) {
		$activities    = bp_activity_get_sitewide( array( 'max' => $limit ) );
		$activity_feed = array();

		for ( $i = 0, $count = count( $activities ); $i < $count; ++$i ) {
			$title                            = explode( '<span', $activities[$i]['content'] );
			$activity_feed[$i]['title']       = trim( strip_tags( $title[0] ) );
			$activity_feed[$i]['link']        = $activities[$i]['primary_link'];
			$activity_feed[$i]['description'] = @sprintf( $activities[$i]['content'], '' );
			$activity_feed[$i]['pubdate']     = $activities[$i]['date_recorded'];
		}

		return $activity_feed;
	}


Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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