so do you want to hide the new topic form every time this particular forum displays (easier), or just for this particular shortcode on a page (more difficult) ?
Ideally, I would like to dynamically hide this New Topic form, based on my needs. Since that is the more difficult path, can you just give me a high-level idea of where to start? I have built a local unpublished plugin before, so I can go down that route if I need to.
And the for the easier option, how would I just hide it every time for now?
Thanks!
Untested, but find
wp-content/plugins/bbpress/templates/default/bbpress/form-topic.php
transfer this to your pc and edit
change line 31
from
<?php if ( bbp_current_user_can_access_create_topic_form() ) : ?>
to
<?php if ( bbp_current_user_can_access_create_topic_form() && (bbp_get_forum_id() != '2927') ) : ?>
and save
where 2927 is the forum you don’t want to show the form for
then create a directory on your theme called ‘bbpress’
ie wp-content/themes/%your-theme-name%/bbpress
where %your-theme-name% is the name of your theme
Then transfer the file you saved above and put in in the directory called bbpress that you created above, so you end up with
wp-content/themes/%your-theme-name%/bbpress/form-topic.php
bbPress will now use this template instead of the original
If you want multiple forums, you could create and array and test against that
Thanks for the reply here, and sorry for my late one.
I’ve been working on this, and I think it will fit my needs better to prevent certain user types from being able to create new topics in this particular forum. Is that something that’s easier to do?
I have BuddyPress installed, and right now I have Group Types defined. So maybe all users in a certain BuddyPress Group cannot create new topics for this particular forum.
I could create Member Types in BuddyPress if that’s better to use.
Sorry, I will also clarify that I’m going to use your method of hiding the form in some cases, too. I just want to make sure certain user types are not creating new topics in this certain forum (i.e. by manually typing in the URL to do so).