A couple of months ago I was working on a Trac ticket dealing with images and ran into the IMAGE_EDIT_OVERWRITE constant. I had always assumed it did as it said: when set to true and you edit an image, overwrite the original image instead of creating a new one. But a quick test revealed this was not the case. I took a quick run over to the Editing wp-config.php page on the WordPress Codex. But IMAGE_EDIT_OVERWRITE was nowhere to be found. In fact, a search of the Codex only uncovered one result: the WordPress 2.9 release notes, when the constant was first introduced. And unfortunately it said very little: Add ‘IMAGE_EDIT_OVERWRITE’ constant to control edited image save or replace, most useful for setups that have dynamic image resizing Dang. That’s not very helpful at all. So I dove head first into the rabbit hole, reviewing the code and testing behaviour in the dashboard. Default Behaviour When you edit an image, WordPress’ default behaviour (i.e. IMAGE_EDIT_OVERWRITE is false) is to create a new image and leave the original image alone. Actually it creates a new set of images as it needs to generate all the smaller size images as well. Let’s say you have the following photo… photo-1024x683.jpg
Share This

We are using cookies on our website

Please confirm, if you accept our tracking cookies. You can also decline the tracking, so you can continue to visit our website without any data sent to third party services.