Skip to main content
  Wednesday, April 25, 2018
  1 Replies
  1.9K Visits
  Subscribe
Hi, is it possible to upload images programmatically with WP Media Folder? Something like wp_insert_attachment(); but with your plugin. (so that i could create folders and populate them with images)
A
7 years ago
Hi,

Thanks for contacting us here about this extension.
is it possible to upload images programmatically with WP Media Folder? Something like wp_insert_attachment(); but with your plugin. (so that i could create folders and populate them with images)

Yes, first, you can use this function: https://codex.wordpress.org/Function_Reference/wp_insert_attachment
And then use https://codex.wordpress.org/Function_Reference/wp_set_object_terms with the taxonomy = 'wpmf-category'

Hope it helps!
Cheers,
  • Page :
  • 1
There are no replies made for this post yet.