WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Exclude certain JS files from plugin

[Resolved] Exclude certain JS files from plugin

  • Hello,

    Firstly congrats on providing such an excellent plugin.

    I was wondering whether it is possible to exclude certain Javascripts from loading within the plugin? This would be an excellent feature and one that I’m sure would appeal to many other people.

    If this can be done, can you please let me know how?

    If not, do you plan on implementing such a feature on future releases?

    Regards,

    Paul

    http://wordpress.org/extend/plugins/asynchronous-javascript/

Viewing 7 replies - 1 through 7 (of 7 total)
  • You can edit the head.js file of your blog because that is the javascript file that loads javascripts asychronously.
    But, make a backup of website before attempting this.

    Plugin Author Paris Holley
    Member

    @parisholley

    Sure thing, I have started an issue here:

    https://github.com/parisholley/wordpress-asynchronous-javascript/issues/3

    I may get the itch to do it tonight, otherwise this weekend…

    Plugin Author Paris Holley
    Member

    @parisholley

    this feature is now in 1.3.0

    Hello Paris!

    Wow! Thanks so much for taking on board my suggestion and implementing it into the next release.

    When do you expect version 1.3.0 will be available via the WordPress Plugin repository?

    Regards,

    Paul

    Plugin Author Paris Holley
    Member

    @parisholley

    It is therenow

    buddhatunes
    Member

    @buddhatunes

    Hi, great plugin, but it is unclear to me how to exclude specific files. I tried this below on line 125 but cannot get the syntax right. Please let me know if you have any suggestions.

    function filter_headjs(){
    $options = get_option(‘asyncjs’);
    $names = split(‘,’, $options[‘exclude_name’]);
    $files = split(“jwplayer.js,jquery.flexslider.js,jquery.ui.totop.min.js,custom.js,swfobject.js” $options[‘exclude_js’]);

    buddahtunes,

    upgrade plugin to latest release, go into the plugin settings in wp-admin and add either the plugin name or javascript file… all pretty self explanatory. I can confirm working correctly, thanks to Paris!

    remove the code you posted it’s not needed.

    Paul

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] Exclude certain JS files from plugin’ is closed to new replies.