Hey jdaniel,
There are use cases where it makes sense to load the lightbox scripts in archives. They might not be necessary on your site but this plugin is designed for use by as many people as possible. In order for it to be useful to as many people as possible without bloating the plugin with settings, I need to paint with a fairly broad brush.
The scripts and styles we load are very minimal, especially compared to the typical scripts and styles loaded by other WordPress plugins and themes so I don’t have a problem with loading them site-wide. If you would rather they didn’t load in other places, the filters mentioned are there for you to adjust things as you see fit.
This snippet should do what you’re asking, but you might need to adjust it more depending on exactly where you want the plugin scripts to load.
add_action( 'wp_enqueue_scripts', 'prefix_featherlight_singular_only', 12 );
/**
* Remove all WP Featherlight scripts and styles on every screen except single
* posts, pages and custom post type entries.
*
* @since 1.0.0
* @access public
* @return void
*/
function prefix_featherlight_singular_only() {
if ( ! is_singular() ) {
add_filter( 'wp_featherlight_load_css', '__return_false' );
add_filter( 'wp_featherlight_load_js', '__return_false' );
}
}