yes, this has been happening for a while (it happens on this site!) , and I’ve not got round to looking at why until you posted (I am a bbpress user who helps out here, not one of the bbpress authors).
I’ve just dug into the code and created a trac fix ticket for it
https://bbpress.trac.wordpress.org/ticket/3429#ticket
in the meantime, this code fixes the problem
add_filter ('bbp_bump_user_topic_count' , 'rew_new_topic_count', 10 , 4) ;
function rew_new_topic_count ($user_topic_count, $user_id, $difference, $count) {
//check if count is 2 and should be 1 by seeing if user topic count is empty!!
if ($user_topic_count==2 && empty (bbp_get_user_topic_count( $user_id, true )) )$user_topic_count = 1 ;
return $user_topic_count ;
}
add_filter ('bbp_bump_user_reply_count' , 'rew_new_reply_count', 10 , 4) ;
function rew_new_reply_count ($user_reply_count, $user_id, $difference, $count) {
//check if count is 2 and should be 1 by seeing if user topic count is empty!!
if ($user_reply_count==2 && empty (bbp_get_user_reply_count( $user_id, true )) )$user_reply_count = 1 ;
return $user_reply_count ;
}
Put this in your child theme’s function file –
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
or use
Code Snippets
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>