wp-featherlight icon indicating copy to clipboard operation
wp-featherlight copied to clipboard

Auto-disable assets where no lightboxable images

Open lkraav opened this issue 6 years ago • 2 comments

Hi. Loading too much unnecessary JS is always a concern. Human-curated meta box configuration is not sustainable.

I'm thinking we could scan via the_content filter, or possibly output buffer the whole page output, for a heuristic on whether to load our JS/CSS assets at all.

Your thoughts?

lkraav avatar Feb 22 '19 08:02 lkraav

This is an interesting idea. I'm not sure that scanning the_content would be robust enough as many pages could be built using meta data, widgets, etc. I'm open to reviewing a PR for this, if you have something specific in mind.

robneu avatar Apr 19 '19 18:04 robneu

I'm not sure that scanning the_content would be robust enough as many pages could be built using meta data, widgets, etc.

Full page output buffering might indeed be the only way. I know some plugins are doing such ob for their purposes, so it's not unheard of.

lkraav avatar Apr 19 '19 18:04 lkraav