Skip to main content
  Wednesday, December 19 2018
  3 Replies
  4.2K Visits
  Subscribe
Are there any specified functions or hooks for creating folders in code and to upload files into them? I need to create a frontend interface for users to upload files, and I want to separate the files in the media library. The "User folder" doesn't seem to fulfill my requirement, as the folder may be created before the user that will upload the files.
A
5 years ago
Hi,

Thanks for contacting us here about this extension.
Are there any specified functions or hooks for creating folders in code and to upload files into them?

You can try these functions below:
https://codex.wordpress.org/Function_Reference/wp_insert_term
https://codex.wordpress.org/Function_Reference/wp_set_object_terms

Hope it helps!
Cheers,
D
Hi,

Currently we have no helpers for developers, but it's in the todo list, but you can still use WordPress functions to do what you want.

Folders uses the custom taxonomy "wpmf-category".
You can then create folder by using wp_insert_term with this taxonomy and set an attachment to a folder using wp_set_object_terms.

In addition, you can have a look on the existing hooks here https://www.joomunited.com/wp-media-folder-developer-documentation

Best regards
R
5 years ago
Thank you. I suspected it wasn't much more complicated than that, but code-diving it myself probably would have taken longer than this.
  • Page :
  • 1
There are no replies made for this post yet.