functions.php: add a fix for bbpress not showing js editor support

This commit is contained in:
Silvan Calarco 2024-01-28 12:04:51 +01:00
parent 901183399f
commit f8b87c9bf8

View File

@ -470,3 +470,15 @@ function prevent_multisite_signup()
die(); die();
} }
add_action( 'signup_header', 'prevent_multisite_signup' ); add_action( 'signup_header', 'prevent_multisite_signup' );
/* Fix for missing js support in bbpress editor */
add_filter ('bbp_body_class', 'rew_unset_no_js') ;
function rew_unset_no_js($classes) {
if (in_array ('single-forum', $classes) || in_array ('single-topic', $classes)) {
if (($key = array_search('no-js', $classes)) !== false) {
unset($classes[$key]);
}
}
return $classes ;
}