I did a little investigating and it looks like what I want could be achieved by modifying the buildGalleries
function in js/wpFeatherlight.js
. Within this function, a jQuery function .find( '.gallery-item a' )
is called twice with slight variation (.gallery-item
and .tiled-gallery-item
). This makes the lightbox apply to any links in WP galleries.
As I mentioned, however, the File Gallery plugin allows you to place non-image files in galleries as well in order to list files by tag from the Media Library. I suspect that what I want can be achieved by changing the jQuery function call to .find( '.gallery-item a[data-featherlight=image]' )
(mutatis mutandis) to capture only those links in WP galleries which link to image files when creating a lightbox gallery.
Edit: I just tested it, and indeed, by filtering image links from WP galleries specifically, Featherlight will only consider image files for lightbox gallery creation. It’d be nice if the plugin authors could consider such a feature for future versions in some way.
-
This reply was modified 6 years, 6 months ago by carbeck.