hi @mahdiar,
of course there is a way ! 😉
Add this to bp-custom.php, and tell us if it is what you needed
function bpfr_fav_count() {
// bail if activity component is not used
if ( !bp_is_active( 'activity' ) ) {
return false;
}
// action
$my_fav_count = bp_activity_get_meta( bp_get_activity_id(), 'favorite_count' );
// formating action result
if ( ! empty( $my_fav_count ) ) {
$text = sprintf( _n( 'Favorited by %d user.', 'Favorited by %d users.', $my_fav_count, 'text_domain' ), bp_core_number_format( $my_fav_count ) );
}
// output
echo $text;
}
add_action( 'bp_activity_entry_meta', 'bpfr_fav_count' );
Thanks a lot !!
I’m developing BSALA plugin So I need it very much .
Dan, is there a way to count up the number of favorites for all activity and create a stream of “Most Favorited”?