bp_get_activity_css_class()

Return the current activity item’s CSS class.

Description

Return

(string) The activity item's CSS class.

Source

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

	function bp_get_activity_css_class() {
		global $activities_template;

		/**
		 * Filters the available mini activity actions available as CSS classes.
		 *
		 * @since BuddyPress 1.2.0
		 *
		 * @param array $value Array of classes used to determine classes applied to HTML element.
		 */
		$mini_activity_actions = apply_filters( 'bp_activity_mini_activity_types', array(
			'friendship_accepted',
			'friendship_created',
			'new_blog',
			'joined_group',
			'created_group',
			'new_member'
		) );

		$class = ' activity-item';

		if ( in_array( $activities_template->activity->type, (array) $mini_activity_actions ) || empty( $activities_template->activity->content ) ) {
			$class .= ' mini';
		}

		if ( bp_activity_get_comment_count() && bp_activity_can_comment() ) {
			$class .= ' has-comments';
		}

		/**
		 * Filters the determined classes to add to the HTML element.
		 *
		 * @since BuddyPress 1.0.0
		 *
		 * @param string $value Classes to be added to the HTML element.
		 */
		return apply_filters( 'bp_get_activity_css_class', $activities_template->activity->component . ' ' . $activities_template->activity->type . $class );
	}/**

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.