@snark: I’ve modified the function to this:
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>';
}
endif;
}
endif;
}
add_action( 'bp_activity_entry_meta', 'my_favorite_count' );
Apart from shortening my function name, this shows the count only if the visitor is logged in.
This code goes into bp-custom.php, and it outputs the count next to the Favorite or Remove Favorite button.
I’ve put this into my bp-custom.php:
function my_show_favorite_count() {
$my_fav_count = bp_activity_get_meta( $_POST['id'], 'favorite_count' );
echo $my_fav_count;
}
add_action( 'bp_activity_entry_meta', 'my_show_favorite_count' );
to get the total number of times an activity has been favourited…
But, nothing shows up… Am I missing something here?