Re: Show favourite count after each activity?
@snark: Try this, for pluralization…
function my_favorite_count() {
$my_fav_count = bp_activity_get_meta( bp_get_activity_id(), 'favorite_count' );
if ($my_fav_count >= 1) : {
if (is_user_logged_in()) : {
echo '<span>(' . $my_fav_count . ')</span> favorite';
if ($my_fav_count > 1) :
{echo 's';} //this turns favorite into favorites
endif;
}
endif;
}
endif;
}
add_action( 'bp_activity_entry_meta', 'my_favorite_count' );
I’ve been sidetracked by a couple of other things that needed my attention, so I haven’t been able to make it do what I’d really like it to do, ie: show the number within the favorite link, like it shows in the reply link:
[Reply (12)] [Favorite (23)]
.
For consistency.
And the other issue of updating the number on clicking the link.
And, showing the users who’ve favourited the activity.
About the other issue, I’ve been trying to find the source of those links, too… Not much luck with that, yet.