I want to create a plugin for WordPress that converts all non-webp images into webp.
I have created a function that takes the file path as an argument and creates a new webp image from that file.
Now I am stuck, how can I replace this old image with a new one in all posts where the old image is used?