Support » Plugin: W3 Total Cache » Exclude theme/plugin CSS file from Minify via filter?

  • Resolved wpexplorer

    (@wpexplorer)


    I tried searching the code and docs but couldn’t find anything. Is there any way to hook into the plugin to exclude specific CSS files from the minify function (via the handle).

    For my Total theme I load 2 files using a media attribute and these need to be excluded from the minify function but I don’t want my customers to have to manually do this. I believe the plugin should exclude these automatically as it doesn’t make sense to combine files with a media attribute – also breaks the popular WooCommerce plugin.

    Anyway, is there any way to add code to my theme to tell the plugin to exclude specific files from the minify functionality? Thanks! (I know I could update the field programmatically, but this isn’t an optimal method). I would hope there is a filter available that returns an array of the excluded CSS files that we can append items to.

    Thanks!!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello @wpexplorer

    Thank you for your inquiry and I am happy to assist you with this.
    Let me double-check this and get back to you as soon as I have an answer.
    Thanks!

    Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello @wpexplorer

    Thank you for your patience.
    In /w3-total-cache//Minify_AutoCss.php you check the lines 211-213

    $do_tag_minification = apply_filters(
    			'w3tc_minify_css_do_tag_minification',
    			$do_tag_minification, $style_tag, $file );

    You can use it toexclude theme/plugin css rom minification
    Thanks!

    Thread Starter wpexplorer

    (@wpexplorer)

    Awesome, You are the best, thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Exclude theme/plugin CSS file from Minify via filter?’ is closed to new replies.