-
-
Notifications
You must be signed in to change notification settings - Fork 41
Review upload_dir processing #307
Description
There was a recent Wordpress support issue raised for bulk import. This caused me to investigate in greater detail the media file upload process. It is possible to identify more directly whether the upload is for the target file or for the thumbnail. Only in the case of target file being uploaded is the upload directory filter applied (as this is the only time the upload directory needs to be changed to the document library).
On download, the directory to be used using the "get_attached_file" filter - and here we can simply decide if the attachment is for a document and build the file location directly. This removes any process where core WP uses a caching process which may then need to be over-ridden).
Any thumbnail (when retrieved) does not have a document as its parent.