当前位置: 首页>>代码示例>>PHP>>正文


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怎么用?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);
}
开发者ID:nxtclass,项目名称:NXTClass,代码行数:21,代码来源:bp-activity-functions.php

示例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);
}
开发者ID:eresyyl,项目名称:mk,代码行数:18,代码来源:bp-activity-functions.php

示例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 );
}
开发者ID:n-sane,项目名称:zaroka,代码行数:8,代码来源:bp-activity.php


注:本文中的BP_Activity_Activity::total_favorite_count方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。