Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imagesloaded.js is included in wordpress #19

Closed
BinaryMoon opened this issue Aug 14, 2016 · 6 comments
Closed

imagesloaded.js is included in wordpress #19

BinaryMoon opened this issue Aug 14, 2016 · 6 comments
Assignees
Labels

Comments

@BinaryMoon
Copy link
Contributor

I noticed tailor has bundled it's own version of imagesloaded.

It's best practice to make use of scripts in WordPress so that the same scripts don't get loaded multiple times.

The WordPress script is registered with the handle imagesloaded.

@andrew-worsfold
Copy link
Contributor

I agree. This has been on my list of things to do for a while. I'll switch over to the bundled version and, assuming there are no problems, have this included in the next release.

@andrew-worsfold
Copy link
Contributor

I haven't included this in version 1.5.0, as although it worked in my local environment I encountered an error with the bundled WordPress imagesLoaded script not enqueuing in a staging environment. I'm not sure, but on that server it looked like the script was bundled with masonry.js (which I'm not using).

Can imagesloaded definitely be enqueued using its own handle in the latest version of WordPress?

@BinaryMoon
Copy link
Contributor Author

imagesloaded is a masonry dependency. I think in WordPress 4.5 they were in the same file, but in 4.6 they were separated, so if masonry is used then imagesloaded will also be enqueued.

You can see where they discuss this change here: https://core.trac.wordpress.org/ticket/32802#comment:20

@andrew-worsfold
Copy link
Contributor

As previous prior to 4.6 need to be supported, I've kept a local copy of imagesloaded around just in case. The bundled version will be used when available, but as I am not using the masonry.js script, it would be overkill to load it just for the benefit of using the bundled imagesloaded script.

Does that sound like a reasonable solution?

@BinaryMoon
Copy link
Contributor Author

sounds good! :)

@andrew-worsfold
Copy link
Contributor

Great! That solution is in place now with Tailor 1.5.1. I'll close out this issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants