bp_activity_total_favorites_for_user( int $user_id )

Retrieve the number of favorite activity stream items a user has.

Parameters Parameters


(int) (Required) ID of the user whose favorite count is being requested.

Top ↑

Return Return

(int) Total favorite count for the user.

Source Source

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

function bp_activity_total_favorites_for_user( $user_id = 0 ) {

	// Fallback on displayed user, and then logged in user.
	if ( empty( $user_id ) ) {
		$user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id();

	return BP_Activity_Activity::total_favorite_count( $user_id );

Top ↑

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.