Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: bbp_get_user_topic_count returns incorrect number

@anonymized-18731058

Inactive

Hi Robin,
Unfortunately, the code you’ve provided isn’t working for me. However, bbp_get_user_topic_count_raw and bbp_get_user_reply_count_raw work fine, so I’ve replaced the functions using JavaScript.

<?php
$topicCount = bbp_get_user_topic_count_raw(wp_get_current_user()->ID);
$replyCount = bbp_get_user_reply_count_raw(wp_get_current_user()->ID);
?>

<script>
var topicCount = document.querySelector('.bbp-user-topic-count');
var replyCount = document.querySelector('.bbp-user-reply-count');
if(topicCount){topicCount.innerHTML = 'Topics Created: ' + '<?php echo $topicCount ?>'}
if(replyCount){replyCount.innerHTML = 'Replies Created: ' + '<?php echo $replyCount ?>'}
</script>
Skip to toolbar