• villekautto

    (@villekautto)


    Hi! After updating to WP 6.4 I started experiencing the following issue on all my sites (30+) with Minify HTML plugin active:

    When saving any post, page or CPT, the content will convert to Classic block. I suspect this is because of a recent WP core change and Minify HTML is now minifying the content in the editor.

    Deactivating all plugins resolves the issue. Then activating Minify HTML causes the issue to reappear again.

    For the time being I have deactivated Minify HTML on all my sites.

    The recent Spanish topic “Comprime también el backend” appears to be the same issue as this: content is minified in the editor.

Viewing 11 replies - 16 through 26 (of 26 total)
  • okay, i updated the code so i can add to a custom plugin for now.
    but it doesn’t seem to work too on the backend, so not preventing conversion to classic block.

    // Ensure that the function exists before attempting to remove it
    if (function_exists('teckel_init_minify_html')) {
        // Remove the original filter hook
        remove_filter('template_redirect', 'teckel_init_minify_html');
    }
    
    // Define your modified function
    function new_teckel_init_minify_html() {
        if (is_admin() || (defined('REST_REQUEST') && REST_REQUEST) || (defined('DOING_AJAX') && DOING_AJAX)) {
            return;
        }
        $minify_html_active = get_option('minify_html_active');
        if ($minify_html_active != 'no') {
            ob_start('teckel_minify_html_output');
        }
    }
    
    // Add your modified function as a filter hook
    add_filter('template_redirect', 'new_teckel_init_minify_html');

    Though, the conversion to classic block does happen on every save draft or update. but it doesn’t matter when you refresh the page after updating. It all is back to normal.

    @sujaljain007 I modified the code directly in plugin. Plugin doesn’t get many updates and I hope it get’s updated with fix I’ve provided or similar as plugin author was active here.

    Hello

    Same problem here…

    Anybody found a working fix ?

    Regards

    @jirsbek ok thanks !

    Where is this function ? in function.php ?

    @byothe Well teckel_init_minify_html() is original function located directly in the plugin’s core file minify-html.php. As it’s definitely not ideal to modify the file directly it’s the only way I made the modification work. I hope author is watching this post and will update the plugin.

    Thank you ??

    gringopost

    (@gringopost)

    I have the same issue for weeks now and it is pain in th***. Any update guys on this fix? Very much appreciated

    • This reply was modified 3 months ago by gringopost.
    byothe

    (@byothe)

    gringopost

    (@gringopost)

    Where do you add this?

    function teckel_init_minify_html() {
    if (is_admin() || (defined(‘REST_REQUEST’) && REST_REQUEST) || (defined(‘DOING_AJAX’) && DOING_AJAX)) {
    return;
    }
    $minify_html_active = get_option(‘minify_html_active’);
    if ($minify_html_active != ‘no’) {
    ob_start(‘teckel_minify_html_output’);
    }
    }
    add_action(‘template_redirect’, ‘teckel_init_minify_html’);

    byothe

    (@byothe)

    @gringopost

    It’s in the minify-html.php file… in the plugin directory on your site

    wp-content > plugins > minify-html-markup > minify-html.php

Viewing 11 replies - 16 through 26 (of 26 total)
  • You must be logged in to reply to this topic.