bp_activity_newest_class( string $classes = '' )

Add a just-posted classes to the most recent activity item.

Description

We use these classes to avoid pagination issues when items are loaded dynamically into the activity feed.

Parameters

$classes

(Optional) Array of classes for most recent activity item.

Default value: ''

Return

(string) $classes

Source

File: bp-activity/bp-activity-filters.php

function bp_activity_newest_class( $classes = '' ) {
	$bp = buddypress();

	if ( ! empty( $bp->activity->last_recorded ) && $bp->activity->last_recorded == bp_get_activity_date_recorded() ) {
		$classes .= ' new-update';
	}

	$classes .= ' just-posted';
	return $classes;
}

Changelog

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