Many of the WordPress website users fetches the media image in featured image section or content editor to be displayed at front-end. Now, the big headache is if we want to change an image to some new image then we will have to change it in all the posts types where this image has been used.
WP Media Replace solves this headache by managing everything smoothly.
A brief about the logics:
- Goto to edit more section of a media item and in bottom you will find “Replace Media” section.
- Upload and new image which will replace the exisiting image in this media item.
- Suppose you are having an image named as “existing.png” and you want to replace it with “new.png”.
- Upload “new.png” in “Replace Media” section and click on “Update”.
- “existing.png” will be moved to “del” folder and “new.png” will be copied and renamed as “existing.png”.
- Now, you will have to same images with different names “exising.png” and “new.png” to overcome this issue check the box to delete the “new.png” at the time of uploading it.
This section describes how to install the plugin and get it working.
wp-media-replacefolder to the
- Activate the plugin through the ‘Plugins’ menu in WordPress
- Check the Edit Media page to see the “Replace Media” section working.
- What happens to original image?
We keep a backup of original image, original image is moved to “del” folder.
- What about the the other sizes of the image, are they getting replaced?
Yes, if an image “existing.png” have 2 sizes or more as “existing-150X150.png” and “existing-300X300.png” then these images will also be replaced with the new image and names of the images will be kept same.
- What about the database changes, any modifications are done in synchronized image metadatas?
No, overall logic is we are replacing an exsiting image with a new media image, we take the name of original image (all sizes) -> moves the original images to “del” folder -> take the name of new image -> create a copy of new image and name it as original image.
- What if my original image is having a “large” size and new image do not have “large” size?
As wordpress default maintains 4 sizes of media images “thumbnail”, “medium”, “medium_large” & “large”. Depending on the aspect ratio of image we uplad the different thumbnail versions are created. If original image is having “large” size but new image have only “thumbnail”, “medium”, “medium_large” then “large” size for the new image will be created by plugin and it will use the fulll size of the image.
Người đóng góp & Lập trình viên
“WP Media Replace” là mã nguồn mở. Những người sau đã đóng góp vào plugin này.Những người đóng góp
Dịch “WP Media Replace” sang ngôn ngữ của bạn.
Muốn tham gia phát triển?
Duyệt code, check out SVN repository, hoặc theo dõi nhật ký phát triển qua RSS.