-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Having an issue with GravityForms plugin. Cannot edit any form in the admin due to Javascript error. They recently updated their plugin to use AJAX in the backend for the form builder and it is clashing with a body class possibly.
I have narrowed the issue down to the themes.php feature in the _bootstrap_filter_body_html() function. When I comment out the following code it works completely fine in the admin:
function _bootstrap_filter_body_html($buffer) {
$theme_json = _bootstrap_get_theme_json();
$resolve_preset = _bootstrap_get_preset_resolver($theme_json);
$background_color = query_object($theme_json, 'styles.color.background') ?: (
get_background_color()
? '#' . get_background_color()
: ''
);
$bs_theme = '';
if ($background_color) {
$brightness = brightness($background_color);
if ($brightness < 100) {
$bs_theme = 'dark';
}
}
$bs_theme = apply_filters('bootstrap_theme', $bs_theme);
if ($bs_theme) {
$buffer = preg_replace('/<body([^>]+)/', sprintf('<body$1 data-bs-theme="%s"', $bs_theme), $buffer);
}
return $buffer;
}
ob_start();
add_action('shutdown', function() {
$final = '';
$levels = ob_get_level();
for ($i = 0; $i < $levels; $i++) {
$final .= ob_get_clean();
}
echo _bootstrap_filter_body_html($final);
}, 0);Thanks for your contributions, and I hope this helps!
Metadata
Metadata
Assignees
Labels
No labels