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

Add option to enable only of needed #72

Open
arnowelzel opened this issue Mar 5, 2021 · 2 comments
Open

Add option to enable only of needed #72

arnowelzel opened this issue Mar 5, 2021 · 2 comments

Comments

@arnowelzel
Copy link
Owner

Also see https://wordpress.org/support/topic/include-lightbox-js-only-when-gallery-is-used-on-that-page

Detecting the need of queuing scripts and styles is not possible since this requires access to the final post output which is not available before the scripts and styles got queued already.

However before queuing scripts and styles the raw post content could be checked if there is a Wordpress gallery shortcode or a Gutenberg gallery block used. This could be used to offer an option like "enable only if post or page contains a Wordpress or Gutenberg gallery".

@arnowelzel arnowelzel changed the title Add option to queue script/styles only of needed Add option to enable only of needed Mar 5, 2021
@mtoensing
Copy link

That would be a wonderful feature.

@maxime-pasquier
Copy link

It will be great yeah! Especially for the CSS in the head (the JS is in the footer so I don't really care ^^)
The lower we load, the faster we get!

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

No branches or pull requests

3 participants