Skip Navigation

[Resolved] Can I give a Custom Post Type its own specific upload path in the media library?

This support ticket is created 7 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 1 reply, has 2 voices.

Last updated by Beda 7 years, 8 months ago.

Assisted by: Beda.

Author
Posts
#419467

This may be a very specialized request, but I'm wondering if it's possible to define a specific media library upload path for a certain Custom Post Type? So that the files uploaded to post in this CPT would always be in folders under a fixed parent folder.

It could be either inside or outside the regular wp-contents/uploads path.

I'm looking for this in order to set certain access parameters in .htaccess for the files uploaded to this Custom Post Type.

#419581

It is not possible within Toolset, as our Plugins is bound to WordPress standards (compatibility is the main reason).

If you want to experiment with Custom Code, here are a few hints:
http://wordpress.stackexchange.com/questions/76895/different-upload-directory-based-on-post-type-in-a-theme
http://wordpress.stackexchange.com/questions/95829/set-custom-upload-path-for-custom-post-type-only
http://wordpress.stackexchange.com/questions/83248/post-type-specific-upload-folder-in-3-5

But I can not suggest to do it, it might have relevant side effects on the display engine (Types, Views and Layouts), which are looking for images only in the standard Upload paths (also other data you upload).

I apologise that this can not be done with Toolset out of the box, and I can not recommend the approach.

Maybe you can find a solution by using Access plugin and giving Access to Post Types, Fields or Forms only to certain user Roles or single users:
https://toolset.com/documentation/user-guides/#access

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.