From f8b87c9bf8ba16fb3d3215b4973c5abc2eef9ad1 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sun, 28 Jan 2024 12:04:51 +0100 Subject: [PATCH] functions.php: add a fix for bbpress not showing js editor support --- functions.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/functions.php b/functions.php index 83832a3..da35586 100644 --- a/functions.php +++ b/functions.php @@ -470,3 +470,15 @@ function prevent_multisite_signup() die(); } 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 ; +}