Currently links and img tag src attributes referencing sized images (thumbnails) are not replaced during a search and replace upload. This could potentially leave a lot of content with broken links and images.
This PR aims to fix this by replacing each old size URL with the new file's version of that specific size, falling back to the full URL if the size does not exist for the new file. The fallback should be enough in current versions of WordPress as width and height attributes are often used in img tags and srcset is usually generated on render to override them anyway.
Resolves #10
Currently links and
img
tagsrc
attributes referencing sized images (thumbnails) are not replaced during a search and replace upload. This could potentially leave a lot of content with broken links and images.This PR aims to fix this by replacing each old size URL with the new file's version of that specific size, falling back to the full URL if the size does not exist for the new file. The fallback should be enough in current versions of WordPress as
width
andheight
attributes are often used inimg
tags andsrcset
is usually generated on render to override them anyway.