/** * Returns the total favorite count for a specified user * * @since 1.2.0 * * @param int $user_id Defaults to 0 * * @uses bp_activity_total_favorites_for_user() * @uses apply_filters() To call the 'bp_get_total_favorite_count_for_user' hook * * @return int The total favorite count for a specified user */ function bp_get_total_favorite_count_for_user($user_id = 0) { return apply_filters('bp_get_total_favorite_count_for_user', bp_activity_total_favorites_for_user($user_id)); }
/** * Return the total favorite count for a specified user. * * @since BuddyPress (1.2.0) * * @uses bp_activity_total_favorites_for_user() * @uses apply_filters() To call the 'bp_get_total_favorite_count_for_user' hook * * @param int $user_id ID of user being queried. Default: displayed user ID. * @return int The total favorite count for the specified user. */ function bp_get_total_favorite_count_for_user($user_id = 0) { // Default to displayed user if none is passed $user_id = empty($user_id) ? bp_displayed_user_id() : $user_id; // Get user meta if user ID exists $retval = !empty($user_id) ? bp_activity_total_favorites_for_user($user_id) : false; /** * Filters the total favorite count for a user. * * @since BuddyPress (1.2.0) * * @param int|bool $retval Total favorite count for a user. False on no favorites. */ return apply_filters('bp_get_total_favorite_count_for_user', $retval); }
/** * Return the total favorite count for a specified user. * * @since 1.2.0 * * @uses bp_activity_total_favorites_for_user() * @uses apply_filters() To call the 'bp_get_total_favorite_count_for_user' hook. * * @param int $user_id ID of user being queried. Default: displayed user ID. * @return int The total favorite count for the specified user. */ function bp_get_total_favorite_count_for_user($user_id = 0) { $retval = false; if (bp_activity_can_favorite()) { // Default to displayed user if none is passed. $user_id = empty($user_id) ? bp_displayed_user_id() : $user_id; // Get user meta if user ID exists. if (!empty($user_id)) { $retval = bp_activity_total_favorites_for_user($user_id); } } /** * Filters the total favorite count for a user. * * @since 1.2.0 * * @param int|bool $retval Total favorite count for a user. False on no favorites. */ return apply_filters('bp_get_total_favorite_count_for_user', $retval); }
/** * Return the total favorite count for a specified user. * * @since BuddyPress (1.2) * * @uses bp_activity_total_favorites_for_user() * @uses apply_filters() To call the 'bp_get_total_favorite_count_for_user' hook * * @param int $user_id ID of user being queried. Default: displayed user ID. * @return int The total favorite count for the specified user. */ function bp_get_total_favorite_count_for_user($user_id = 0) { // Default to displayed user if none is passed $user_id = empty($user_id) ? bp_displayed_user_id() : $user_id; // Get user meta if user ID exists $retval = !empty($user_id) ? bp_activity_total_favorites_for_user($user_id) : false; return apply_filters('bp_get_total_favorite_count_for_user', $retval); }
/** * Return the total favorite count for a specified user. * * @since BuddyPress (1.2) * * @uses bp_activity_total_favorites_for_user() * @uses apply_filters() To call the 'bp_get_total_favorite_count_for_user' hook * * @param int $user_id ID of user being queried. Default: displayed user ID. * @return int The total favorite count for the specified user. */ function bp_get_total_favorite_count_for_user($user_id = 0) { if (!$user_id) { $user_id = bp_displayed_user_id(); } return apply_filters('bp_get_total_favorite_count_for_user', bp_activity_total_favorites_for_user($user_id)); }