API for Support by other plugins (Lightbox with Photoswipe)
-
I am the author of “Lightbox with Photoswipe” and recently got a support request because images served by mapped domains will be identified as “external” images.
However this can cause issues in some cases, depending on the configuration of the webserver – also see https://www.ads-software.com/support/topic/bug-402/ and the proposed workaround which at least works in my local test environment.
To make life easier for the users of our plugins I wonder if there is an API I could use in my plugin to determine the URL mapping and use that to make sure that even on mapped URLs images are properly detected as “local” images and not images coming from other websites.
My idea:
- Check if a specific class or global variable exists as an indicator that your plugin is installed.
- If the plugin is installed use a specific API to get the list of mapped domains, so I can use them to identify images which are served using one of those domains but are originating from the main website – that way I can still retrieve meta data and attachement information properly.
As a result, users of your plugin don’t have to manually deal with adding additional mappings as CDN urls to the plugin settings in “Lightbox with PhotoSwipe” and don’t wonder, why the images are either not displayed at all in Photoswipe or with missing captions or missing EXIF data.
- The topic ‘API for Support by other plugins (Lightbox with Photoswipe)’ is closed to new replies.