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 filter for caption content #94

Open arnowelzel opened 1 year ago

arnowelzel commented 1 year ago

Also see: https://wordpress.org/support/topic/add_filter-function/

Some users may want to add some copyright notice to the caption without the need of modifying all existing image descriptions.

This could be achieved using an additional filter for the caption content which would be called before the caption will be send to the frontent. The filter should not modify the caption which is stored in the cache to avoid confusion when people create a filter function and want to change that text. By calling the filter right before creating the frontend output one can dynamically change the filter and see the result right away, even if the original caption was read from the cache.