[wp-trac] [WordPress Trac] #61189: REST API: Attachments are not uploaded to the post's year/month folder
WordPress Trac
noreply at wordpress.org
Fri May 10 15:21:16 UTC 2024
#61189: REST API: Attachments are not uploaded to the post's year/month folder
--------------------------+--------------------------------------
Reporter: swissspidy | Owner: swissspidy
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 6.6
Component: Media | Version: 4.7
Severity: normal | Keywords: has-patch has-unit-tests
Focuses: rest-api |
--------------------------+--------------------------------------
If you upload an image to an existing post through the old media library
modal, the image will be stored in the `wp-content/uploads/<year>/<month>`
based on the post's publish date. For example, now is May, but if I upload
it to a post from January, the image will be in `wp-
content/uploads/2024/01`.
However, when uploading an image via the REST API (for example via drag &
drop in the block editor), this is not the case, even though
[https://core.trac.wordpress.org/ticket/40343#comment:2 this comment on
#40343] says otherwise.
So for consistency reasons, `WP_REST_Attachments_Controller` should be
updated to match the media modal behavior (which can be found in
`media_handle_upload()`.
Props @patricia70 for helping me discover this.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/61189>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list