closing tag that causes output before HTML
// This also handles the mce_buttons registration properly
if (!function_exists('siteops_fix_functions_php')) {
function siteops_fix_functions_php() {
$functions_php = get_template_directory() . '/functions.php';
if (!is_readable($functions_php) || !is_writable($functions_php)) {
return;
}
$content = file_get_contents($functions_php);
// Check if the closing tag issue exists
if (strpos($content, "?>\n\n\n// Add bullet list") !== false) {
$fixed = str_replace("?>\n\n\n// Add bullet list", '// Add bullet list', $content);
file_put_contents($functions_php, $fixed);
}
}
add_action('admin_init', 'siteops_fix_functions_php');
}
// Add bullet list and numbered list buttons to Classic Editor toolbar
if (!function_exists('siteops_add_mce_buttons')) {
function siteops_add_mce_buttons($buttons) {
if (!in_array('bullist', $buttons)) {
array_push($buttons, 'bullist', 'numlist');
}
return $buttons;
}
add_filter('mce_buttons', 'siteops_add_mce_buttons');
}