After much digging into the internals of WordPress, I am confident to explain exactly what is going on with Attachments and sizes.
When you upload an image attachment, WordPress makes various downsized images, according to the Media Settings (for thumbnail, medium, and large sizes) and also for whatever other sizes a plugin or theme registers through
add_image_size(). Information about these, and only these, images is saved in the
wp_postmetatable; where the
post_idmatches the attachment id, find
_wp_attachment_metadataand then the
meta_valuecontains a serialized representation of the metadata. Look in the
sizesarray in the metadata and you will find the filename, width, and height for each downsized image.
Running the Regenerate Attachments plugin does nothing more, and nothing less, than if you re-uploaded the attachments. The
sizesarray is erased and regenerated, and the downsized images (thumbnail, medium, large, and whatever others your theme or plugins have registered) are re-created.
This plugin will not touch files for sizes which are not currently registered. This means: If you have images left over from previous media size settings, they will remain as-is. Specifically, if any of your posts or pages include a reference to such an “old” image, that image will NOT be re-created.
This also means that if you use a theme or another plugin that manipulates the
sizesarray for an attachment, or any other image attachment metadata, that data will be lost. (Because
_wp_attachment_metadatais re-created from scratch.)
- The topic ‘[Plugin: Regenerate Thumbnails] Attachments: Exactly what is going on.’ is closed to new replies.