Is it possible to modify the URLs of the image attachments for the current post, so that the browser receives html with modified URLs in the img tags?
I don't want to be updating the image attachment attributes.
I'm looking for the same flexibility as exists for the post content, being that it's possible to read-in, modify then return the_content of a post.
I am aware of wp_get_attachment_image_src()
and the_post_thumbnail_url()
as means of fetching the attachment URL. But I can't find any means of returning a modified URL for the current post.
One possibility is to use output buffering to catch the final HTML, using ob_start()
etc
But is there some more targeted method for parsing post image attachments?