Hi,
Let me start by saying that I’m a novice and am happy that you’ve started turning PhotoSwipe into a full fledged plug in.
That said, the idea of modifying every post rather than inserting data-size="XXXxYYY"
in all the <a>
tags with php, seems like a real backwards method of solving this problem. It dirties every post with this excess of information, that will remain, even if the plugin is uninstalled. IMHO plug-in’s should be totally “non-destructive” in their installation, leaving no trace of their presence if uninstalled.
Additionally, this approach doesn’t work with featured images. I thought I’d be able to modify my singles.php file with the standard size of my images 1440×960, but then realized that a few of my header images are cropped down, so they’re now being stretched vertically if clicked on…
Modifying this seems promising
<?php
list($width, $height, $type, $attr) = getimagesize("img/flag.jpg");
echo "<img src=\"img/flag.jpg\" $attr alt=\"getimagesize() example\" />";
?>
If I figure it out I’ll report back, since this plug-in is perfect otherwise and I would like to do what I can to help.
Thanks,
Jon