There si a hook that you could use eg for replies there is
/** Additional Actions (Before Save) **************************************/
do_action( 'bbp_new_reply_pre_extras', $topic_id, $forum_id );
// Bail if errors
if ( bbp_has_errors() ) {
return;
}
in includes/replies/functions.php line 354 or thereabouts depending on version
so you could have a hook to add action that checks if bbp_has_errors and if so mail the user before the function bails.
This refers to bbPress 2.6.4.
If a new user topic or reply fails bbPress moderation (either links or bad words), the end user gets no message at all. What they see is simply nothing – just the edit box again, with no indication that their post was marked as pending, and awaits moderation.
So what happens? The user reposts the same message, over and over and over. I have examples of users reposting 10 times. They eventually may ask what is going on, or go away angry.
This seems to be new behavior since 2.6, and depending on the forum admins, this behavior may seem to be mysterious. I’ve run a highly technical forum for years, and did not know about this changed behavior in 2.6 because users typically did not post with more than 2 links.
Even now knowing that, the users are still left mystified. This is very poor user interface design, and the only reasonable solution now is to essentially eliminate any moderation at all.
add_filter( 'bbp_bypass_check_for_moderation', '__return_true' );
Much much better would be to let the user know what happened. I’ve read all the code for moderation, and can’t see any filters to override to add a message for the user.
It would be wonderful to fix this issue, and issue a “Your topic/reply is awaiting moderation.”
The moderators need to get a message as well.
ok, put this in your child theme’s function file – or use
Code Snippets
add_filter( 'bbp_register_topic_post_type', 'rew') ;
function rew ($rew) {
$rew = array(
'labels' => bbp_get_topic_post_type_labels(),
'rewrite' => bbp_get_topic_post_type_rewrite(),
'supports' => bbp_get_topic_post_type_supports(),
'description' => esc_html__( 'bbPress Topics', 'bbpress' ),
'capabilities' => bbp_get_topic_caps(),
'capability_type' => array( 'topic', 'topics' ),
'menu_position' => 555555,
'has_archive' => ( 'forums' === bbp_show_on_root() ) ? bbp_get_topic_archive_slug() : false,
'exclude_from_search' => true,
'show_in_nav_menus' => true,
'public' => true,
'show_ui' => current_user_can( 'bbp_topics_admin' ),
'can_export' => true,
'hierarchical' => false,
'query_var' => true,
'menu_icon' => '',
'source' => 'bbpress',
) ;
return $rew ;
}
add_filter( 'bbp_register_reply_post_type', 'rew2') ;
function rew2 ($rew) {
$rew2 = array(
'labels' => bbp_get_reply_post_type_labels(),
'rewrite' => bbp_get_reply_post_type_rewrite(),
'supports' => bbp_get_reply_post_type_supports(),
'description' => esc_html__( 'bbPress Replies', 'bbpress' ),
'capabilities' => bbp_get_reply_caps(),
'capability_type' => array( 'reply', 'replies' ),
'menu_position' => 555555,
'exclude_from_search' => true,
'has_archive' => false,
'show_in_nav_menus' => true,
'public' => true,
'show_ui' => current_user_can( 'bbp_replies_admin' ),
'can_export' => true,
'hierarchical' => false,
'query_var' => true,
'menu_icon' => '',
'source' => 'bbpress',
) ;
return $rew2 ;
}
Thanks, so something like this:
// Actually build all of this HTML
function build_html() {
$this->sort_users();
$data = $this->stats_builder();
$HTMLOutput = "";
if (is_user_logged_in()) {
if ( is_bbpress() && current_user_can( 'spectate' ) ) {
foreach( $data as $key => $html ) {
$HTMLOutput .= "<div class='bbpas-" . $key . "' id='bbpas-" . $key . "'>" . $html . "</div>";
}
}
}
return $HTMLOutput;
}
Yes?
add an additional if statement
if ( is_bbpress() && ! current_user_can( 'spectate' ) )
if they can’t spectate then they are blocked
since the plugin is not being maintained, suggest you just edit that file to take out the comment out !!
so change
//if (is_user_logged_in()) {
foreach( $data as $key => $html ) {
$HTMLOutput .= "<div class='bbpas-" . $key . "' id='bbpas-" . $key . "'>" . $html . "</div>";
}
//}
to
if (is_user_logged_in()) {
foreach( $data as $key => $html ) {
$HTMLOutput .= "<div class='bbpas-" . $key . "' id='bbpas-" . $key . "'>" . $html . "</div>";
}
}
Notice this code is actually commented out?
//if (is_user_logged_in()) {
That must have been done for a reason.
Look at the function build_html()
:
// Actually build all of this HTML
function build_html() {
$this->sort_users();
$data = $this->stats_builder();
$HTMLOutput = "";
//if (is_user_logged_in()) {
foreach( $data as $key => $html ) {
$HTMLOutput .= "<div class='bbpas-" . $key . "' id='bbpas-" . $key . "'>" . $html . "</div>";
}
//}
return $HTMLOutput;
}
It calls sort_users();
That in turn does a select query to get a list of active users:
private function sort_users() {
// Set the active users
$this->_activeUsers = $this->get_ActiveUsers();
// Work out the longest time possible for a user to be classed as active
$active_timeframe = strtotime( $this->_sqlTime ) - ( $this->parent->option['user_inactivity_time'] * 60 );
At no point can I see anywhere that it checks to see if the active user is logged in and not blogged in the forum. It should be doing these tests because it should not be exposing user names.
You can see it with my site if you use private mode.
This has to be fixable and I don’t understand why it was never implemented in the first place really. I just don’t know how to do it.
This works:
https://www.publictalksoftware.co.uk/?bbpnns-login=1&redirect_to=https://www.publictalksoftware.co.uk/support-forums/topic/xxx/#post-4784
Hi
I added a reply to a topic with some instructions.
Then, in my main topic I wanted to add a link to the reply so that the user could jump to see it.
For example:
https://www.publictalksoftware.co.uk/support-forums/topic/xxx/#4784
When I click the link it does not jump to that reply. Why?
Yes. I wish I had enough confidence to delve in with this issue myself. It seems it is going to be a simple fix:
display stats = no
is user logged in?
is user forum role not blocked?
display stats = yes
if display stats = yes
show stats
That would be the simplest solution.
Hi there,
I’m building a website with Elementor Pro and bbPress.
I created 2 different Headers: a main one for the Landing page and blog, and another one for the forums.
I used the shortcode to display the forums index on a page I’ve built with Elementor and the Header works fine. But when it comes to the automatically created single pages (topic, reply, search, etc.), it displays the main Header.
I contacted Elementor support, not knowing if the issue was on their side or on yours, and they told me I had to contact you, explaining me this :
“For your information, we usually find this happening when creating custom post types where it is excluded from showing in menus via the custom post type’s “show_in_nav_menus” option; this option is found in the post type’s “register_post_type” function used to add it in WordPress and may be set to “false” in this case […] we highly recommend contacting the bbPress support team to help with changing this option to “true”. The solution we suspect would be similar to using the function code mentioned in this bbPress support post but with the ‘show_in_nav_menus’ variable set to ‘true’ > https://bbpress.org/forums/topic/plugin-snippet-hack-to-include-bbpress-topics-in-wordpress-search/ ”
So, here I am! Can someone help me, please?
Thank you!
Thanks for the quick reply, looks like a code your own day is coming up.
I tried to post as code….will try again. But this didn’t work.
function rew_max_length ($reply_content) {
if (strlen($reply_content)<500) {
bbp_add_error( 'bbp_reply_content', __( '<strong>ERROR</strong>: Your reply must be less than 500 characters.', 'bbpress' ) );
}
return $reply_content ;
}
add_filter( 'bbp_new_reply_pre_content', 'rew_max_length' );
I don’t know how technical you are, this one does the opposite
function rew_min_length ($reply_content) {
if (strlen($reply_content)<61) {
bbp_add_error( 'bbp_reply_content', __( '<strong>ERROR</strong>: Your reply must be at least 60 characters.', 'bbpress' ) );
}
return $reply_content ;
}
add_filter( 'bbp_new_reply_pre_content', 'rew_min_length' );
I mean it would require someone writing some code
the includes/forum/template.php has a function called bbp_get_forum_class which adds classes, but as far as I can see it is never used.
bbp_list_forums in the same template has
// Subforum classes
$subforum_classes = array( 'bbp-forum-link' );
$subforum_classes = apply_filters( 'bbp_list_forums_subforum_classes', $subforum_classes, $sub_forum->ID );
// This could use bbp_get_forum_class() eventually...
$subforum_classes_attr = 'class="' . implode( ' ', array_map( 'sanitize_html_class', $subforum_classes ) ) . '"';
so looks like this is a plan?
anyway you could use the line listed above
$subforum_classes = apply_filters( 'bbp_list_forums_subforum_classes', $subforum_classes, $sub_forum->ID );
to add a call to that function
sorry that’s then best I can do
not possible without additional code
Hi again Robin,
Trying my luck now as it’s no longer for the bbpress part of the page but I’m facing a similar issue with a post carousel I have.

I tried editing the css code you provided me but with no luck.
Any suggestion?
Thank you,
Kev
basically bbpress has the ability to add columns via a filter
This should do it
add_filter("bbp_admin_replies_column_headers", 'rew_IP_column_add');
add_filter("manage_reply_posts_custom_column", 'rew_IP_column_value', 10, 3);
function rew_IP_column_add($columns) {
$new = array();
foreach($columns as $key => $title) {
if ($key=='bbp_reply_forum') // Put the forum ID column before the Replies forum column
$new['rew_id'] = 'IP Address';
$new[$key] = $title;
}
return $new;
}
function rew_IP_column_value($column_name, $id) {
if ($column_name == 'rew_id') echo get_post_meta( $id, '_bbp_author_ip', true );
}
Put this in your child theme’s function file – or use
Code Snippets
Now I’m trying to hide the pagination of the output
My startpage has the page ID 35
I’m trying to use this css to hide the pagination only on the startpage
.page-id-35, a.page-numbers, .page-numbers.current, .page-numbers.dots, .bbp-pagination-count {display:none!important;}
The css works fine, but the addition .page-id-35 does not work
Does anyone see an error?
Thanks
Matthias
I found this code and can now show five popular entries on my frontpage 🙂
// Top five of bbpress on startpage
function rk_top_five_view() {
bbp_register_view( ‘top-five’, __( ‘5 Most Popular Topics’ ), array(
‘meta_key’ => ‘_bbp_reply_count’,
‘posts_per_page’ => ‘5’ ,
‘ max_num_pages’ => ‘1’,
‘orderby’ => ‘meta_value_num’ ),
false );
}
add_action( ‘bbp_register_views’, ‘rk_top_five_view’ );
Thanks
Matthias
@lflier
Wow, this really solves the issue with Visual Editor content styling. Thank you very much!
unction bbp_enable_visual_editor( $args = array() ) {
$args['tinymce'] = array(
'content_css' => '/wp-content/themes/mytheme/css/tinymce-editor.css',
);
return $args;
}
add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );
How to add this to: https://codex.bbpress.org/enable-visual-editor/ ?
I’m using this shortcode on my site.
[bbp-single-view id=’popular’]
Is there a way to show only 5 popular threads instead of 10?
I just tried the following code with no sucess 🙁
[bbp-single-view id=’popular’ max='5']