I have two types of files in my WordPress Media Library, one is for pictures and attachments from posts, the other is for attachments from a custom post type.
I want to organize them separately, use my plugin’s dir as basedir for the custom post type, while keep other files in WordPress’ default upload directory.
Is it possible to add one more basedir?
The following code will change the upload directory for a specific post-type!
Just be sure to swap out both instances of “post-type” (line 14) with the name of your custom post-type.
This was made to work with plugins, but could be modified for use in themes. Hope this helps, let me know if you have any questions!
== UPDATE ==
I forgot to mention, if you’d like to use WordPress’ default year/month method of organizing the uploads folder, simply change lines 15 and 16 to the following: