I wonder if it’s possible to add a filter to all images inside the_content()
to create the following image pattern for all images â¦
<img class="digest" src="smallest-file.jpg" data-fullsrc="largest-file.jpg" alt="something"/>
So I’d like to add a class="digest"
to the img tag. Additionally the src
attribute of the image should always link to the smallest-file wordpress creates and a data-fullsrc
that links to the largest file of the image.
Any idea or approach on how to do this?
I’d really appreciate your help with this as I’m completely helpless right now.
You will need to take a look at the
image_send_to_editor
filter.This will not update existing records but it if you get it working it will apply to each newly inserted image.
very basic filter: