BP_Activity_Activity::get_recorded_components( bool $skip_last_activity = true )

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


Description Description


Parameters Parameters

$skip_last_activity

(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


Top ↑

Return Return

(array) List of component names.


Top ↑

Source 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;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
1.2.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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