[wp-trac] [WordPress Trac] #49096: Allow updating attachments with new files
WordPress Trac
noreply at wordpress.org
Tue Jun 9 20:30:48 UTC 2020
#49096: Allow updating attachments with new files
-------------------------+------------------------------
Reporter: joehoyle | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version:
Severity: normal | Resolution:
Keywords: close | Focuses: rest-api
-------------------------+------------------------------
Changes (by azaozz):
* keywords: => close
Comment:
> For example, maybe I have an image editing app that uses the rest api,
and when a user makes edits, I'd want to post the updated image back and
update the attachment with it.
Been thinking about this for a while and don't think this is a good idea
in general. Perhaps this may be handy in some edge cases, like editing a
just uploaded image, but replacing one image file with another image file
(with possibly different dimensions) has high probability to break prior
posts.
When editing an image (file) best workflow is to always create a "new
version" of the image, and not delete/replace the old, original version.
Then, if deemed necessary, the UI may offer to the users to delete the old
image. However the old/original image should not be deleted/replaced
automatically. There are two reasons:
- The original image may have been used in a post.
- WP may be used as "media storage", deleting originally uploaded files
should never happen without explicit user consent.
Agree with @joemcgill in [#comment:3 comment:3] that the "replace
attachment file" functionality is plugin material, and should be used with
care. Core shouldn't do that. It would be a lot better workflow to create
new attachments for edited images.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49096#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list