本文整理匯總了PHP中BP_Activity_Activity::total_favorite_count方法的典型用法代碼示例。如果您正苦於以下問題:PHP BP_Activity_Activity::total_favorite_count方法的具體用法?PHP BP_Activity_Activity::total_favorite_count怎麽用?PHP BP_Activity_Activity::total_favorite_count使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類BP_Activity_Activity
的用法示例。
在下文中一共展示了BP_Activity_Activity::total_favorite_count方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: bp_activity_total_favorites_for_user
/**
* Retrieve the number of favorite activity stream items a user has
*
* @since 1.2.0
*
* @param int $user_id
*
* @global object $bp BuddyPress global settings
* @uses BP_Activity_Activity::total_favorite_count() {@link BP_Activity_Activity}
*
* @return int Total favorite count
*/
function bp_activity_total_favorites_for_user($user_id = 0)
{
global $bp;
// 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);
}
示例2: bp_activity_total_favorites_for_user
/**
* Retrieve the number of favorite activity stream items a user has.
*
* @since BuddyPress (1.2.0)
*
* @uses BP_Activity_Activity::total_favorite_count() {@link BP_Activity_Activity}
*
* @param int $user_id ID of the user whose favorite count is being requested.
* @return int Total favorite count for the user.
*/
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);
}
示例3: bp_activity_total_favorites_for_user
function bp_activity_total_favorites_for_user( $user_id = false ) {
global $bp;
if ( !$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 );
}