Anyone?
I tried to remove a few permissions with a user role/permissions plugin, but after I hit save they got added again.
untested, and probably from a purist view not the most elegant solution, but this should work
add_filter( 'bbp_current_user_can_access_create_topic_form' , 'rew_only_mods' , 10 , 1) ;
function rew_only_mods ($retval) {
// Users need to earn access
$retval = false;
//check if admin
if ( bbp_is_user_keymaster() ) {
$retval = true;
}
//check if moderator
$role = bbp_get_user_role( get_current_user_id());
if ($role == 'bbp_moderator') {
$retval = true;
}
// Allow access to be filtered
return (bool) apply_filters( 'rew_current_user_can_access_create_topic_form', (bool) $retval );
}
Also allows keymasters, but I presume you want that.
Put this in your child theme’s function file – or use
Code Snippets
great – glad you are fixed
I suppose is not possible to target forum specific moderators to allow them to create topics?
I’m using version 2.6 RC7 that allows to add participants as specific forum moderators.
Would it be possible to check if a participant is moderator of that forum and if yes allow them to create topics?
It’s a bit complicated in my head xD
sorry, I only do live code, so don’t know what rc7 does
Ah ok I get it, thanks just the same Robin. The solution you provided was very helpful.
You are not afraid that this will adversely affect attendance?
Well, I wouldn’t even use bbpress on this LMS website. But my client wants it for something really specific and it needs to prevent normal users to create new topics. We will have a fixed topic where they can suggest themes/areas they want to discuss.
I get its weird but It makes sense for this kinda of project and for what they do.