• Resolved Hossein

    (@h71)


    Hi,

    1. How can developers exclude certain files from their plugin?
    plugin-folder/subfolder/main.js

    2. How to exclude external JS files?
    https://3rdparty-site.com/external.js

    3. How to exclude a certain script that is added using wp_add_inline_script function from a plugin?

    Note: I need a programmatic solution like filters. I need it for plugin development.

    If it is not possible, COuld you please consider adding support for it? Many of popular cache plugins are allowing other developers to use filters to exclude certain JS files.

    • This topic was modified 4 years, 7 months ago by Hossein.
Viewing 1 replies (of 1 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @h71

    Thank you for your inquiry and I am happy to assist you with this.
    You can use w3tc hooks to modify the default behavior by attaching your code to the hook:
    'w3tc_minify_js_do_local_script_minification'
    'w3tc_minify_js_do_tag_minification'
    These hooks controls this.
    As for external JS, W3 Total Cache does not normally deal with those. If enabled in settings – it can grab some external script. In any case it passes through those hooks.
    Thank you!

Viewing 1 replies (of 1 total)
  • The topic ‘Exlude external JS files and Inline scripts’ is closed to new replies.