Skip to:
Content
Pages
Categories
Search
Top
Bottom

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

@robin-w

Moderator

hmm, can’t see why it shoudln’t work

try for test purposes

<?php
$topic = bbp_get_topic_id();
$users = get_users() ;
$countsub = 0;
foreach ($users as $user) {
    $topicsub_list = array(get_usermeta ($user->id, 'wp__bbp_subscriptions', false)) ;
echo '<br>Topic : '.$topic ;
echo '<br>user_id: '.$user->id.'<br>' ;
var_dump ($topicsub_list) ;
    if (in_array ($topic , $topicsub_list))  $countsub++ ;
}
echo $countsub;
?>

that should help you find out where the problem is

Skip to toolbar