arnowelzel / lightbox-photoswipe

Integration of PhotoSwipe to WordPress
https://arnowelzel.de/wp/en/projects/wordpress/lightbox-with-photoswipe
GNU General Public License v2.0
27 stars 7 forks source link

Add option to have plugin disabled by default #68

Open arnowelzel opened 3 years ago

arnowelzel commented 3 years ago

Also see: https://wordpress.org/support/topic/only-enabling-the-plugin-on-selected-pages/

Eventhough the plugin only adds two additional resources some people prefer maximum possible optimization and like to have the plugin only active on pages which need it.

One solution might be to add an advanced option which reverses the meaning of the post/page specific "disable" option - instead of disabling the plugin it will enable it if checked for a specific post/page.

An automatic solution is not possible since the plugin will uses the final output buffer to add data-lbwps- attributes to image links - but this happens after the script and style queue was already processed by WordPress.