admin管理员组文章数量:1392002
I've seen a couple of people ask about this but without a general conclusion.
It worked until recently, but recently all media uploads from the media upload tool end up in an old folder, 2019/10, instead of the one for the current month.
BUT when uploading from a new post, the media goes into the correct folder, for the current month.
So there's different behaviour between uploading from the media upload tool (the stock one), and when uploading from the post editor (the new / Gutenberg one, for blocks).
Any ideas where to start digging?
I've seen a couple of people ask about this but without a general conclusion.
It worked until recently, but recently all media uploads from the media upload tool end up in an old folder, 2019/10, instead of the one for the current month.
BUT when uploading from a new post, the media goes into the correct folder, for the current month.
So there's different behaviour between uploading from the media upload tool (the stock one), and when uploading from the post editor (the new / Gutenberg one, for blocks).
Any ideas where to start digging?
Share Improve this question asked Feb 4, 2020 at 23:27 Ivan VorasIvan Voras 1413 bronze badges 01 Answer
Reset to default 2In case anyone encounters this in the future: after drilling down into the WP source and the database, it turns out that when media files are uploaded, WP still needs to attach them to some post, and for some reason, even though the post_id
is 0 in the fuction which processes media uploads, it managed to find an entry in the wp_posts
table and use that to attach media files to. After that, the mechanism which determins the path to save the media file based on the post it's attached to kicks in, so the file is saved in the folder of the post entry.
I solved this by deleting the entry in the wp_posts
table, after which WP stopped attaching media uploads to post entries, and storing them in the folder structure based on the date of the upload (i.e. the current date).
This took instrumenting the WP source and drilling down into what happens in the database. Definitely seems like a bug, and definitely not solvable in a user-friendly way.
本文标签: uploadsWordPress suddenly starts uploading media to an old (backdated) folder
版权声明:本文标题:uploads - WordPress suddenly starts uploading media to an old (backdated) folder 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744774102a2624520.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论