ok, try
$user_id = wp_get_current_user()->ID;
if ( !bbp_is_user_keymaster($user_id )) {
remove_filter( 'bbp_get_reply_content', 'bbp_make_clickable', 4 );
remove_filter( 'bbp_get_topic_content', 'bbp_make_clickable', 4 );
}
Your code for the page width is still working on ALL pages as expected, therefore the CSS is bieng applied, BUT the code doesn’t apply to the “page.php” template used by the forums !
Do you have a page set up for forums? ier one that is using [bbp-forum-index] ?
no one can post links, wich is good, but the code : !bbp_is_user_keymaster, did not let keymaster be able to do so.
oh and by the way, bbpress links still works on my forum wich is normal I suppose?
Hello Robin,
Yep, always, and this is a copy of the original one where I just changed as advised in one of the forums I mentioned previously, to change the DIV that way :
<div class=”wrap page-full-width“>
<div id=”primary” class=”content-area-wide“>
<main id=”main” class=”site-main” role=”main”>
Actually, both child theme folders (the real site and my VM) contains those files :
– bbpress.php
– functions.php
– page-full-width.php
– screenshot.jpg
– style.css
This latter currently contains only your code as well as the code for background gradient as the page-full-width does the job for the page width, I mean, only for the site pages except forum ones !
The rest is similar.
Regards,
Philippe
untested, but this should make the filter only removed if they are not a keymaster
if ( !bbp_is_user_keymaster()) {
remove_filter( 'bbp_get_reply_content', 'bbp_make_clickable', 4 );
remove_filter( 'bbp_get_topic_content', 'bbp_make_clickable', 4 );
}
Hello Robin,
Don’t know if you could find something to help me, but I keep you informed of the progress on my side.
I’ve installed a virtual machine with the same WordPress version, twenty seventeen theme and almost all the plugins.
I’m now more comfortable “playing” with different themes and child themes, this is the positive side of the situation, I even corrected a mistake I initially made by creating my child theme inside the Twenty seventeen theme instead of at the same level as it !
Now it turns up in the theme section, I can activate it, but basically, it doesn’t make any difference !
Your code for the page width is still working on ALL pages as expected, therefore the CSS is bieng applied, BUT the code doesn’t apply to the “page.php” template used by the forums ! 🙁
I even tried simultaneously to find out a solution for a request from our site members, that’s a background gradient.
It doesn’t apply at all !
In fact, taking a closer look at the wysiwig panel in the Appearance section of the theme, I noticed that the gradient is applied but ONLY on the homepage and behind the image and NOT on the body of all the other pages of the site !
Trying to paste the code in the custom code or straight in the style.css file in the theme child produces the same result…
This is so incredible that nobody in the world can find a solution or has ever tried to customize these elements !
Hope is what makes us live…
Regards
Philippe
The Post Author is not showing anywhere on posts on our Topics page. Is there some custom CSS I can add to have the Author information come up underneath the post title?
We worked with a developer to style the forums, but I don’t want to go back to the developer at this point if possible (I’m not sure he knows what he’s doing), but I also don’t know enough to go into the code.
What I ve done:
1. installed bbpress plugin
2. added a filter bbp_show_lead_topic to do lead topic
3. added a filter bbp_has_replies_query to do DESC order
4. created a forum
5. created a topic under the forum
6. created a reply to the lead topic
7. repeatd 6. a couple of times by clicking Reply of topic-admin-links
8. created a reply to one of the replies created from 7., i.e. threaded reply.
9. got out of the forum, and revisited the forum, and clicked the topic to do a reply
a. clicked a link which is not the one of topic-admin-links, but reply-admin-links
b. but changed mind to click the one of topic-admin-links to the lead topic (remember !! having clicked the reply-admin-links, not clicking send button)
c. put some words into editor and Send
d. the reply is under the reply which was clicked at a., not the lead topic
The Reply topic-admin-links has [reply] => <a href="#new-post" class="bbp-topic-reply-link">Reply</a>
and it is ok before any Reply of reply-admin-links is clicked.
href=”#new-post” is pointing correctly when no bbp_reply_to is, i.e. no reply of reply-admin-links was clicked.
The Reply of reply-admin-links has `[reply] => <a href=”/forums/topic/test-topic1/?bbp_reply_to=18&_wpnonce=1d17517a0b#new-post” class=”bbp-reply-to-link”
onclick=”return addReply.moveForm(‘post-18′,’18’,’new-reply-8′,’8′);”>Reply</a>`
where 8 is the lead topic id, 18 is reply id
As far as reply-admin-links was clicked, href=”#new-post” of the Reply of topic-admin-links is meaning /forums/topic/test-topic1/?bbp_reply_to=18&_wpnonce=1d17517a0b#new-post
I don’t know whether it is the way supposed to be.
Or did I miss anything ?
Hello,
im not a developer.., can someone maybe help me to get the code work?
Thx
Regards
Sally
@padrenola I’ve added a reply on your ticket, but I wanted to post here as well.
The issue you are seeing is related to your theme, so you will want to get in touch with their support to get an official fix. You can send them to the ticket for background. https://bbpress.trac.wordpress.org/ticket/3059
In the meantime, adding the below code to the bottom of your theme’s/child theme’s functions.php file should give you some relief.
remove_filter( 'bbp_get_forum_topic_count_int', 'x_bbpress_filter_forum_topic_count' );
remove_filter( 'bbp_get_forum_reply_count_int', 'x_bbpress_filter_forum_reply_count' );
remove_filter( 'bbp_get_forum_post_count_int', 'x_bbpress_filter_forum_post_count' );
Hey oyegigi,
Thanks for this, it works like a charm. I used the plugin “Shortcodes in Menus” as a quick solution to output to a menu.
Would be great if you could amend the code to show, only if user is logged in?
Thanks again!
Hi,
1.- What you mean with overlap? Do you want to put together both fields? Debates are topics, and Publications are topics and replies.
2.- You can translate bbPress using pod files:
bbPress in Your Language
Also, you can visit this page about bbPress in Spanish
Suerte!
Thanks for the answer @benklocek
I am still looking for the right code, I will post here once I got it 😉
I was thinking what could be the best way…
1.-Create a custom role and then use the name of role to translate it. (I am doing this.)
2.-Give to spectator role the participant´s capabilities and then translate it.
I need two participant roles, with differents name. Just to make more fun the forum style. Just like the ticket about “Add CSS class for user roles in topics and replies”.
Regards,
Here’s the list of names as set by default: http://hookr.io/functions/bbp_get_dynamic_roles/
You should be able to use:
$roles = bbp_get_dynamic_roles();
$print_r( $roles );
to see what the names of your roles are.
Thanks for the code @benklocek
I created a custom role with this code:
//Custom Role Admin
function add_custom_role( $bbp_roles ) {
$bbp_roles['my_custom_role1'] = array(
'name' => 'Admin',
'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as admin
);
return $bbp_roles;
}
add_filter( 'bbp_get_dynamic_roles', 'add_custom_role', 1 );
and I can’t change the role name with @robkk code. But I did with your code. So I wonder what should I change to apply your code for all other roles, participant, moderator?
Thanks!
I tried couple ways but without success. Ex:
function my_custom_roles( $role, $user_id ) {
if( $role == 'Participant' )
return 'Participante';
return $role;
}
add_filter( 'bbp_get_user_display_role', 'my_custom_roles', 10, 2 );
Hi,
According to codex https://codex.bbpress.org/getting-started/before-installing/bbpress-user-roles-and-capabilities/ Moderators should be able to publish and edit forums.
This seems to be a bug cause they can’t. I’ve been reading a bunch of topics now and it seems like this has been a bug for more than FOUR YEARS. Why hasn’t codex been updated??
I’ve seen hints pointing out that moderators can actualy publish forums on front end with shortcode [bbp-forum-form] – this works but they can still not edit forums.
I’ve tried to edit the keymaster role and disable access to global forum settings but this didn’t work. There are a bunch of capabilities for every single action of bbpress. And then there is on huge capability for a monster amount of actions. This capability is keep_gate. When I disabled that for the keymaster role I managed to disable acces to global forum settings but acces to publish and edit forums was also disabled.
I want to achieve a role that has ALL the keymaster capabilities except from access to admin pages bbpress (global forum settings) and bbp-repair.
Is there anyway to do this?
Thanks!
Hi,
Plugin is on https://wordpress.org/plugins/bbp-api/ but let me see to copy the code to GitHub this weekend.
@jpvanmuijen on 2 of my forums it seems to give stats, but we should have that discussion at the support forum for bbp-api 🙂
Pascal.
I am trying to replace all the topics in a specific forum with the new topic form whenever I press on the Create New Topic button.
Then I tried to ajaxify it using the shortcode [bbp-topic-form], but the form didn’t showed up…
In the functions.php I have added this:
wp_enqueue_script( 'script', get_stylesheet_directory_uri() . '/js/topicButton.js', array ( 'jquery' ), 1.1, true);
wp_localize_script( 'script', 'script', array(
'ajaxurl' => admin_url( 'admin-ajax.php' )
));
..
..
add_action('wp_ajax_script', 'scriptfunc');
add_action('wp_ajax_nopriv_script', 'scriptfunc');
function scriptfunc() {
echo do_shortcode("[bbp-topic-form]");
die();
}
The ajax file
(function($) {
function find_forum_id() {
var forumidval = document.getElementsByTagName("article")[0].id;
forumidval = forumidval.replace(/\D/g,'');
return parseInt( forumidval );
}
$(document).on( 'click', '.bbp-new-topic-button', function( event ) {
event.preventDefault();
forumid = find_forum_id();
$.ajax({
url: ajaxurl,
type: 'post',
data: {
action: 'scriptfunc',
forumid: forumid
},
beforeSend: function() {
$('.bbp-topics').remove();
},
success: function( html ) {
$('article').append( html );
}
})
});
})(jQuery);
@jpvanmuijen I started looking at how bbPress works under the hood just recently, so I’m learning these things just by looking into the code and trying to guess. I’m glad I didn’t give a wrong hint 🙂
I’m not sure if there’s any higher-level logic wrapping this in bbPress functions, though; any experienced bbPress guy is more than welcome to expand on this: I’d be happy to know if there’s a better way.
Hopefully, with the REST API this sort of tasks will become pretty straight forward 🙂
@jpvanmuijen
Assuming $single_item[‘id’] contains the id of the reply, this should do what you want:
$topic_id = get_post( $single_item[‘id’] )->post_parent;
Hi everybody,
I was actually starting a topic about this, a few days ago, but my post contains a bunch of links (more than 3) to help contextualize the discussion and it’s still pending approval.
If moderators can help with that, the link to the topic is:
https://bbpress.org/?post_type=topic&p=181440
(I hope it’s not a problem to link it here; in case, feel free to delete or edit this reply)
I was trying to start writing a first version of a REST API too, as I missed the latest posts by Pascal. Also, I looked for existing code here:
https://github.com/ePascalC/bbp-API
but found only empty files. Am I missing something?
Anyway, I downladed the plugin and checked the code there.
Mine differs a bit as I was using BP-REST as a starter: I saw they had an extensive discussion about how to frame the whole work and structure it for the longer term, so I thought it was a good idea to take that into consideration.
If you think we might join efforts on this, let me know; I have limited time to invest on this but I’d be pleased to give my contribution whenever I can.
Cheers,
s t e
Hi RotiSoft,
The code that i supplied in a pastebin, should hopefully solve the issue.
If not, the problem could rely in another plugin, and i may therefore ask you to disable them all, and enable them one after one. 🙂
-Fuske
ok, it could be several places
lets start with
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
can you look in that file for lines of code that start with
add_action
and list any that you see here
sorry, missed that you were using wp tweaks which adds this sidebar. This plugin has no support, and doesn’t work with several themes by the look of it.
suggest you try
https://en-gb.wordpress.org/plugins/widget-logic/
the logic for forum pages is
is_bbpress()
for a widget to only show on forum pages
and to exclude from forum pages is
!is_bbpress()