This should show the items in the specific menu.
add_filter( 'wp_nav_menu_items', 'rkk_add_auth_links', 10 , 2 );
function rkk_add_auth_links( $items, $args ) {
if (is_user_logged_in() && $args->theme_location == 'sub-header-menu') {
$items .= '<li><a href="'. wp_logout_url() .'">Log Out</a></li>';
}
elseif (!is_user_logged_in() && $args->theme_location == 'sub-header-menu') {
$items .= '<li><a href="'. site_url('wp-login.php') .'">Log In</a></li>';
$items .= '<li><a href="'. site_url('wp-login.php?action=register') .'">Register</a></li>';
$items .= '<li><a href="'. site_url('wp-login.php?action=lostpassword') .'">Lost Password</a></li>';
}
return $items;
}
By default it leads to the regular wordpress login form. if you want to change that to a frontend page, you can change this site_url('wp-login.php') to something like this site_url('/login/').
login redirect you would need to use something like this.
function rkk_login_redirect($redirect_to, $request, $user) {
return (is_array($user->roles) && in_array('administrator', $user->roles)) ? admin_url() : site_url('/forums/');
}
add_filter('login_redirect', 'rkk_login_redirect', 10, 3);
This login redirect code redirect admins to the WordPress backend, but anything else to the forums.
@sumanthbhe
Try this to remove the comma.
add_filter('bbp_after_list_forums_parse_args', 'rkk_bbpress_list_forums' );
function rkk_bbpress_list_forums() {
$args['separator'] = '';
return $args;
}
Okay sorry for the late reply.
This is how I tested it.
Without reply threading
Topic author gets notified like normal no problem. It shows the repliers name and everything fine.
With Reply threading
Topic author gets notified of a unthreaded reply like normal no problem. It shows the repliers name and everything fine.
If the topic author threads under a reply. The reply author who commented that is being threaded does not get a notification, neither does the topic author.
If a user replies to their own reply the topic author gets notified.
if the topic author replies to an already threaded reply by another user, the topic author gets notified of the other user replying although it was the topic author. So although the user being replied to should get the notification, the user replying is.
iF a user replies to an already threaded reply created by the topic author, the topic author gets notified that they have replied although it was the other user.
If a user replies to an already threaded reply, sometimes the topic author may receive two notifications one with the user who replied and also one that says the topic author just replied also.
All i can really say that these notifications are a mess…
I am creating replies as a test user but for some reason the topic author is getting all of the notifications, even for threaded replies being posted under my test user’s reply even though in the code for the notifications it states that the test user should receive a notification.
I created a ticket for this bug in the trac though.
https://bbpress.trac.wordpress.org/ticket/2869
I am trying to use bbPress with a custom theme. I have a child theme and I have a bbpress.php created. The forum page loads but none of the links work (Forum, author, search). It’s as though the whole section is behind a sheet of glass. I can’t even select text. They work in the default themes. They work if I use the custom theme and create a page using a shortcode. Disabling all plugins doesn’t help.
It’s making me crazy. Any thoughts as to what might be blocking the page?
Unfortunately the template builder isn’t very helpful. His default response is that they never said it would work with bbpress. While true, I wouldn’t think it should eat normal functionality.
Almost solved:
function lugpa_change_subscribe_button_texts($args){
$fakeCbox = "<span class='subscribe-icon'></span>";
$args = array_merge($args, array(
'before' => '',
'subscribe'=> $fakeCbox.' Subscribe to thread notifications',
'unsubscribe'=> $fakeCbox.' Unsubscribe from thread notifications',
));
return $args;
}
// in a future please check if all these hooks subscribes to a "topic"
add_filter('bbp_before_get_forum_subscribe_link_parse_args', 'lugpa_change_subscribe_button_texts');
add_filter('bbp_before_get_topic_subscribe_link_parse_args', 'lugpa_change_subscribe_button_texts');
add_filter('bbp_before_get_user_subscribe_link_parse_args', 'lugpa_change_subscribe_button_texts');
However I’m not sure if all these hooks works over the same thing. Meaning, if they all are related to “thread subscriptions”.
One more thing: I’d like to be able to distinguish if I’m in “replys” page or in “my subscriptions” page. Because If I’m in the second one I should keep the short version.
Is it possible to get some more information into what I should to do add features to TinyMCE or even TinyMCE Advanced in bbPress?
I’ve looked into the Enable Visual Editor guide, and currently I’ve only got that enabled for users. I like it that way. However, I’d also like to display the “Paragraph”, “Heading” etc. feature. And even when I installed TinyMCE Advanced, nothing changed within bbPress.
Optimally, I will be able to display only “Paragraph”, “Heading 3” and below, for better SEO.
Edit: This is what I have currently:

Hi.
I’m trying to add content before the subscribe button. It would be a fake checkbox. But I’m not being actually able to use “before” option in bbp_topic_subscription_link function.
Bug can be reproduced with something like this:
bbp_topic_subscription_link(
array(
'subscribe'=>'Subscribe to thread notifications',
'unsubscribe'=>'Unsubscribe from thread notifications',
'before' => 'x'
) );
That “x” will never appear. I can see it still in line 1055 of bbpress/includes/users/template.php, just before bbp_parse_args call. After that content dissapears:
var_dump($args);
// Parse arguments against default values
$r = bbp_parse_args( $args, array(
'subscribe' => __( 'Subscribe', 'bbpress' ),
'unsubscribe' => __( 'Unsubscribe', 'bbpress' ),
'user_id' => 0,
'topic_id' => 0,
'forum_id' => 0,
'before' => ' | ',
'after' => ''
), 'get_user_subscribe_link' );
var_dump($r);
Also, there’s another issue: ajax call will not keep my custom text. After you press the button text changes to defaults: subscribe \ unsubscribe. So, what’s the point of a custom text?
Hope my request is clear.
Thanks for all your work.
@robkk, further to my previous reply: perhaps I could hide the link on the main menu with CSS if we can’t get it to work.
I was also wondering if the code could include a line to redirect the user to the forum page after login? Could the code also include links for Register and Lost Password?
Hello all,
I would like to know if there are any plugins or code snippet using which the members of the buddypress group can automatically subscribe to the forum to receive email notification on new topic creation.
Receiving email notification for every topic being created in the group forum is a huge matter of concern for me. I tried I would like to know if there are any ways to make the user of a particular group be subscribed only to the forums of that group?
I tried the code mentioned here – https://bbpress.org/forums/topic/new-users-auto-subscribe-to-one-forum/#post-146665
But this makes the user subscribe to all the forums of all the groups which is not appropriate for us. Can someone help me with this regard? Thanks.
Links in Email Notifications
Hello, maybe this is already possible but I can’t find any information about it – how can I embed links in the notification email to subscribers to a topic? Even if I code in links using HTML they seem to be stripped out in the resulting email message.
Thanks,
Kitka
@robkk yes I tried it like this – nothing shows up.
My free theme is Responsive (not Responsive II) from Cyberchimps.
I would really appreciate it if we could get to the bottom of it.
All this works only if I use the code as it is without the menu location but the links go to both menus.
Thanks.
You can use this CSS.
#bbpress-forums .bbp-forums-list {
display: none;
}
see if what is poated here may help.
How to Stop Admin subscription emails…
You can also try this plugin, it has code that might be in bbPress core in the future.
https://wordpress.org/plugins/asyncronous-bbpress-subscriptions/
on the forum slug:
http://discoversee.com/seeforums/
I would like to remove the links to the subforums – only showing the forums.
is there a code, CSS or function code I can use to remove these? Or the links to them?
Just to clarify I want the user to be able to set the status on the front end when they are posting a new topic.
That code worked but only lets me do it from the back end
@casiepa
I guess you can also use this.
function change_translate_text( $translated_text ) {
if ( $translated_text == ‘Oh bother! No topics were found here!’) {
$translated_text = ‘No topics were found here!’;
}
return $translated_text;
}
add_filter( 'gettext', 'change_translate_text', 20 );
Great. thanks for this.
I tried adding the code to my functions.php file but it didnt work. Do I need to do something special with it?
It is possible to add custom statuses with this plugin.
https://wordpress.org/plugins/buddy-bbpress-support-topic/
Here is an example gist file.
https://gist.github.com/imath/9e69b8139ff6f7a4120a
Here is example for Urgent.
function your_custom_status( $allstatus = array() ) {
$allstatus['topic-working-on-it'] = array(
'sb-caption' => __( 'Urgent', 'buddy-bbpress-support-topic' ),
'value' => 3,
'prefix-title' => __( '[Urgent] ', 'buddy-bbpress-support-topic' ),
'admin_class' => 'urgent',
'dashicon' => array( 'class' => 'bpbbpst-dashicons-warning', 'content' => '"\f534"' ),
);
return $allstatus;
}
add_filter( 'bpbbpst_get_support_status', 'your_custom_status', 10, 1 );
You did try it like this right??
if(is_bbpress() && $args->menu->slug == 'sub_header_menu')
If it still doesn’t work you can try finding the menu location in your theme, which might most likely be in the functions.php file, but it could be different depending on the theme. You would spot by the register nav menu function like what is listed in this page.
https://codex.wordpress.org/Function_Reference/register_nav_menus
If you have a free theme I could check it out and get the arguments you need.
This is the CSS causing the issue. You are stretching a 14px image to 40px, that is why it is so blurry.
#bbpress-forums p.bbp-topic-meta img.avatar,
#bbpress-forums ul.bbp-reply-revision-log img.avatar,
#bbpress-forums ul.bbp-topic-revision-log img.avatar,
#bbpress-forums div.bbp-template-notice img.avatar,
#bbpress-forums .widget_display_topics img.avatar,
#bbpress-forums .widget_display_replies img.avatar {
border: none;
width: 40px;
}
See if the PHP code snippet in this topic can help you resize the 14px avatars better.
Resizing Avatars
I guess you can try this code instead to see if it works any. I guess I can can also just check out to see if the custom script file name changed. I am using an older version of Divi 2.4 for testing so it could be a possibility.
You can contact me here if you want me to check it out on your site later.
Contact
add_action( 'wp_print_scripts', 'rkk_reply_threading_divi' );
function rkk_reply_threading_divi() {
if( is_bbpress() && bbp_is_single_topic() ) {
wp_dequeue_script( 'divi-custom-script' );
}
}
When I use this code without the
if(is_bbpress() && $args->theme_location == 'sub-header-menu')
it works but I get the links on both menus. Below is the code I tried to use for the second menu only – the second menu is called Logins – I tried to use both sub-header-menu or logins.
I tried your suggestion with both as well.
add_filter( 'wp_nav_menu_items', 'my_nav_menu_login_link' );
function my_nav_menu_login_link($menu) {
//uncomment the next line if you only want login on bbpress pages
if(is_bbpress() && $args->theme_location == 'sub-header-menu')
if (is_user_logged_in()) {
//set the $url on the next line to the page you want users to go back to when they logout
$url = '$url = 'http://www.mysite.com/forums';
$url2=wp_logout_url($url) ;
$loginlink = '<li><a title="Logout" href="'.$url2.'">Logout</a></li>';
}
else {
$current_user = wp_get_current_user();
$user=$current_user->user_login ;
//set $page on the next line = the permalink for your login page
$page=''login' ;
$loginlink = '<li><a href="/'.$page.'/">Login</a></li>';
}
//uncomment out the next lines if you only want login on bbpress pages
}
else {
$loginlink="" ;
}
$menu = $menu . $loginlink;
return $menu;
}
Thank you @robkk It didn’t work, but I only have a basic understanding, so I’m not exactly sure if I put the code in the right place in the file. Here is what my functions.php file looks like with the code you provided.
<?php
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array('parent-style')
);
}
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
register_nav_menus( array(
'primary-menu' => __( 'Primary Menu', 'Divi' ),
'profile-menu' => __( 'Profile Menu', 'Divi' ),
'secondary-menu' => __( 'Secondary Menu', 'Divi' ),
'footer-menu' => __( 'Footer Menu', 'Divi' ),
) );
add_action( 'wp_print_scripts', 'rkk_reply_threading_divi' );
function rkk_reply_threading_divi() {
if( function_exists( 'is_bbpress' ) && bbp_is_single_topic() && bbp_thread_replies() )
{
wp_dequeue_script( 'divi-custom-script' );
}
}
?>
You could post the code you are using so I can double check to see how it is if you still want to do this manually without a plugin.
There should be forum for each company name.
Just create a new forum for each company.
All threads specific to that company needs to be created there.
You can create group forums with the help of buddyPress or bbPress private groups to enforce this. Other than that just tell users to post there.
Now on searching city, state, region or holding company related forums/threads should come in results. I want to create menu where in he can click on city and find related company names available in that city.
Not sure where the city, state, region, holding company data is kept. I am guessing since each company has a forum, that each company’s data could be the city, state, region. I guess create a forum taxonomy for each?
Then make the bbPress forum search or whatever search you are using for the site to be able to search forum taxonomies?
I want to create menu where in he can click on city and find related company names available in that city.
I guess create a custom query?? bbPress has if_has_forums() to be able to do this I guess.
https://codex.wordpress.org/Class_Reference/WP_Query
I can’t really help any more since this is custom development.