• Resolved Magenta Cuda

    (@magenta-cuda)


    With respect to JavaScript file minification I have written a tool for automatically generating W3TC JSON configuration files. It works by modifying the value of ‘minify.js.groups’ to the ordered list of JavaScript files that it observed as WordPress emitted the HTML script elements. This works except when a plugin uses the ‘template_include’ filter to load a template from the plugin’s directory instead of a template from the theme’s directory. It appears to me that W3TC in manual minify mode cannot handle templates loaded by the filter ‘template_include’. Is this true and is there a workaround?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello,

    It’s irrelevant which hook is used, plugin analyzes resulting HTML only. And depending on the HTML form of script inclusion/loading, it may catch it or not. Not because of the hook that was used.

    Thread Starter Magenta Cuda

    (@magenta-cuda)

    “it may catch it or not.” – What does this mean?

    My observation is that W3TC in manual minify mode does not seem to see templates that are not in the active theme directory. If the hook ‘template_include’ is used to override the template from the active theme and load a template from the plugin directory W3TC seems to ignore it and use the template from the active theme directory that would have been used if the ‘template_include’ hook was not executed.

    • This reply was modified 6 years, 1 month ago by Magenta Cuda.
    • This reply was modified 6 years, 1 month ago by Magenta Cuda.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problem in manual minify mode when a plugin uses the filter ‘template_include’’ is closed to new replies.