Gator Gate Pre for bbPress adds reliable Visual Editor <pre> support to front-end bbPress topic and reply forms on a per-forum basis.
On each forum’s edit screen (Attributes metabox) you will find three checkboxes:
The Pre button and paste panel appear by default whenever the visual editor is enabled.
Other plugins (or a theme’s functions.php file) can control the Pre button with the gg_pre_show_pre_button filter:
// Hide the Pre button everywhere
add_filter( ‘gator_gate_pre_show_pre_button’, ‘__return_false’ );
// Force the Pre button on everywhere
add_filter( ‘gator_gate_pre_show_pre_button’, ‘__return_true’ );
// Target a specific forum ID
add_filter( ‘gator_gate_pre_show_pre_button’, function( $show, $forum_id ) {
if ( 123 === (int) $forum_id ) {
return false; // hide on forum 123
}
return $show;
}, 10, 2 );
100% free plugin under the GPL license.