Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Get Number of Favorites & Subscription to a topic

@babblebey

Participant

I guess I will be patient for you to test this Robin


$topic = bbp_get_topic_id();
$users = get_users() ;
$count = 0;
foreach ($users as $user) {
    $topic_list = get_usermeta ($user->id, 'wp__bbp_favorites', false) ;
    if (in_array ($topic , $topic_list))  $count++ ;
}
echo $count;

I am getting the error

Warning: in_array() expects parameter 2 to be array, string given in C:\wamp\www\omna\wp-content\themes\omna2\bbpress\content-single-topic-lead.php on line 134

Skip to toolbar