I’ve been doing a lot of research and I’ve yet to work this out. Can you add in a custom option in the Attachment Display Settings
(part of Insert Media
dialog in post editor)?
What I’m after is the ability to add an anchor with a class around all images in posts.
This will add a field in the attachment edit screen for applying a class to the img tag.
You just need to add this to your theme’s
functions.php
file: