P.s
A very important thing would be also to force the user to select a category of the forum where to write up the title of his new topic
Hi there, I am wondering this as well — using the short code [bbp-topic-form] is it possible to make the “Forum” dropdown menu a required field, and to require that in that drop down users choose a forum and not be able to choose “no forums” (which currently shows as the the default option).
is it possible to make the “Forum” dropdown menu a required field, and to require that in that drop down users choose a forum and not be able to choose “no forums” (which currently shows as the the default option).
I will create a trac ticket for this later today. It might be best for it to be required and for the default text to be “choose forum” instead.
You can create a button to your new topic page easily by using the text widget provided from WordPress, and adding this simple HTML.
<a href="http://yoursite.com/new-topic" class="button">New Topic</a>
That would be great — thank you for creating a ticket. Your suggestion of having the default text be “choose forum” is perfect.
Heck I might not need to, it may already be in the next major release.
If you go to this sites new topic page, you will see the forum dropdown does not show the (no forum), it just displays the first form in the list by default.
Create New Topic
Will check to make sure later though.
I”ve been reading these topic about “new topic button” and I’m just curious why this isn’t included in the plugin? Most major forums have this feature and when I click on “Start Topic” I don’t have to choose the forum where I want the topic posted. So if I click on “start new topic” in the “General Discussions” forum, it post the topic there. I don’t have to select where to post the topic.
Would love to see this feature in future releases. Thanks for the hard work on bbpress.
@geog272
For having a forum show up instead of the (No Forum), copy form-topic.php in your child theme.
In the code toward line 109 you would see something like this.
<?php if ( !bbp_is_single_forum() ) : ?>
<?php do_action( 'bbp_theme_before_topic_form_forum' ); ?>
<p>
<label for="bbp_forum_id"><?php _e( 'Forum:', 'bbpress' ); ?></label><br />
<?php
bbp_dropdown( array(
'show_none' => __( '(No Forum)', 'bbpress' ),
'selected' => bbp_get_form_topic_forum()
) );
?>
</p>
<?php do_action( 'bbp_theme_after_topic_form_forum' ); ?>
<?php endif; ?>
Remove 'show_none' => __( '(No Forum)', 'bbpress' ),
so it would look like this.
<?php if ( !bbp_is_single_forum() ) : ?>
<?php do_action( 'bbp_theme_before_topic_form_forum' ); ?>
<p>
<label for="bbp_forum_id"><?php _e( 'Forum:', 'bbpress' ); ?></label><br />
<?php
bbp_dropdown( array(
'selected' => bbp_get_form_topic_forum()
) );
?>
</p>
<?php do_action( 'bbp_theme_after_topic_form_forum' ); ?>
<?php endif; ?>
Thanks so much for responding and providing this code. It doesn’t quite do it in my case, as it allows users to choose to post to categories as well as forums, and I’d like to force them to choose a forum.
It should just be forums. Categories are greyed out and cannot be selected.
Geez, I swear it was letting me pick the categories before, but went back and tested and it seems fine now. Must be gremlins in my machine. Thanks very much; this is very helpful.
Oh they got you too. Freaking Gremlins 😆