We recently changed themes. The new theme uses different dimension thumbnails and I was a bonehead and deleted all previous thumbnail sizes. Deleting the thumbnail sizes results in many of the images in my posts throwing a 404 error as the specific size is no longer there. I have regenerated thumbnails to the new sizes using a plugin like Regenerate Thumbnails. The problem is, this does not replace the image SRCs in posts, so images are still not showing up.
Looking around, it looks like there is no "easy" solution to this problem. Rather, I need to manually go through the database and update the image SRCs. My question is, is there any function I can use to regenerate the SRCs on a per post basis? For example, if I were to pass the post_id to a function, could I somehow get all the images in that post and regenerate their SRCs? Maybe a function that simulates the "Add Media" or "Edit Media" button, but programmatically (i.e. if I were to manually go in and modify each image, it gets updated properly)?