• Hello,
    Could someone tell me how to unload all the CSS and JS files enqueued by the plugin?

    I’m planning on manually loading them later but I can’t seem to unload them no matter what I do…

    So far I’ve found their handles for my site (ABHfrontend.min.js, ABHfrontend.min.css and ABHhidedefault.min.css) and tried using wp_dequeue_style and wp_deregister_style (and the script equivalents) in wp_head, wp_enqueue_scripts and wp_print_styles (also tried with different priorities)…
    I’ve also tried unloading them through the Asset Manager plugin but it didn’t work as well (which is the first time I’ve seen it fail)…

    Not sure what I’m doing wrong so I’d appreciate some help.

    Thanks in advance!

Viewing 1 replies (of 1 total)
  • Thread Starter WPBot

    (@wpbot)

    I managed to remove the files through this code, but I’m not sure it’s the best possible solution, so I’m still open for alternatives.

    add_filter( 'style_loader_src', function($href){
    
        if( (strpos($href, "frontend.min.css") !== false) || (strpos($href, "hidedefault.min.css") !== false) ) {
            return false;
        }else {
            return $href;
        }
    
    });
    
    add_filter( 'script_loader_src', function($href){
        if(strpos($href, "frontend.min.js") !== false) {
            return false;
        }
        return $href;
    });
Viewing 1 replies (of 1 total)

The topic ‘Unload CSS & JS’ is closed to new replies.