本文整理汇总了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 );
}