I have the same problem. I found a workaround, but it’s not a 100%.
Add a “break;” to bbpress-pf.php after line 34 so that the function looks like this:
//Disallowed?
foreach($current_user->roles as $role){
if(in_array($role, $disallowed_roles)){
ob_start();
add_action( 'bbp_theme_after_topic_form', 'pf_stop_capture');
break;
}
}
Otherwise the action gets called too many times, messing up the session and leading to the page rendering out of order.
This is not a perfect workaround because it still causes the icons in the WordPress toolbar to not display. But otherwise it seems to solve the problem.
Would be great if this were fixed. 🙁
I think I found a workaround to the toolbar icons not displaying (or at least, it’s working for me). Add this code:
wp_enqueue_style('dashicons-css', '/wp-includes/css/dashicons.min.css');
to the pf_stop_capture method:
function pf_stop_capture(){
ob_get_clean();
remove_action('bbp_theme_after_topic_form', 'pf_stop_capture');
wp_enqueue_style('dashicons-css', '/wp-includes/css/dashicons.min.css');
}
This worked for me, as well. Thank you!
@wesley
this works for me here too.
however, as i am allowing people to post even if they are not registered/logged in I added – just after //Disallowed ?
if(!is_user_logged_in()){
ob_start();
add_action( 'bbp_theme_after_topic_form', 'pf_stop_capture');
return;
}
as i think the chances are that – if one want sto restrict topic creation – than this should also by default apply to non logged in users too i would have thought.
works for me anyway
These changes worked perfectly! Someone really should fork this plugin off and implement these changes to the core code
Thanks a lot! I had the same problem and it worked for me, too! 😀