How to check if user does not have particular role in bbpress?

34 views Asked by At

I have function that checks if user has more than 15 posts on forum, but I want also to implement that this user must not havve role "BLOCKED".

$user_id = get_current_user_id()  ;
$topic_count  = bbp_get_user_topic_count_raw( $user_id);
$reply_count = bbp_get_user_reply_count_raw( $user_id);
$post_count   = (int) $topic_count + $reply_count;      
if ($post_count > 15) { 
//show here
}

Now, what I want is: If user has no BLOCKED role and has more than 15 posts show them this. I can't find way to do this, so anyone knows the function and how to apply it on my code?

0

There are 0 answers