BP_Activity_Activity::get_recorded_components( bool $skip_last_activity = true )

Get a list of components that have recorded activity associated with them.

Description

Parameters

$skip_last_activity

(bool) (Optional) If true, components will not be included if the only activity type associated with them is 'last_activity'. (Since 2.0.0, 'last_activity' is stored in the activity table, but these items are not full-fledged activity items.) Default: true.

Default value: true

Return

(array) List of component names.

Source

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

	public static function get_recorded_components( $skip_last_activity = true ) {
		global $wpdb;

		$bp = buddypress();

		if ( true === $skip_last_activity ) {
			$components = $wpdb->get_col( "SELECT DISTINCT component FROM {$bp->activity->table_name} WHERE action != '' AND action != 'last_activity' ORDER BY component ASC" );
		} else {
			$components = $wpdb->get_col( "SELECT DISTINCT component FROM {$bp->activity->table_name} ORDER BY component ASC" );
		}

		return $components;
	}

Changelog

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