if only registered users can post, then I’d start by looking at how they are registering – bbpress just uses wordpress registration, so how are your users joining ?
It’s also a woocommerce site, and anyone can register to download digital goods without making a purchase. So that’s how they are registering, but they shouldn’t be able to post anything to the forum, yet some how they are able to.
so what does ‘ I’ve achieved this by editing all of the template files that bbPress has dealing with viewing a reply or being able to post. ‘ mean ?
Ok for example, in the template file loop-single-reply.php, at the bottom, instead of this normal code:
<div class="bbp-reply-content">
<?php do_action( 'bbp_theme_before_reply_content' ); ?>
<?php bbp_reply_content(); ?>
<?php do_action( 'bbp_theme_after_reply_content' ); ?>
</div><!-- .bbp-reply-content -->
I have custom code wrapped around the bbp_reply_content(); function so that the reply form will only load for my active members:
<div class="bbp-reply-content">
<?php do_action( 'bbp_theme_before_reply_content' ); ?>
<?php if (((function_exists('wc_memberships_is_user_active_member')) && (wc_memberships_is_user_active_member(get_current_user_id(), 'biotic-pro-membership'))) { ?>
<?php bbp_reply_content(); ?>
<?php } else {
echo $noaccess;
} ?>
<?php do_action( 'bbp_theme_after_reply_content' ); ?>
</div><!-- .bbp-reply-content -->
hhmm… not sure how that would prevent the forums being shown
I’d suggest you add that code to
form-topic.php and form-reply.php
I do have that code on those other templates as well, so it works well. You know what though, I just found out that I didn’t have any custom code added to form-topic.php, so that must be how they are creating new topics. SMH. I thought that I had all of the template files customized and that they were somehow creating new posts via URL, RSS, or some other “back door” method. Thanks for your time, you can close this post.
great – glad you are fixed !!