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.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744774103a4592940.html
评论列表(0条)