1. jzilberberg
  2. Feature ideas for WP Media Folder
  3. Tuesday, 04 June 2019
  4.  Subscribe via email
I have a custom file upload method that I wrote that uploads to the media library. When it uploads it goes to the root WP Media Folder structure. I want to add some code to add to my custom method, like a shortcode, that will allow me to put that file directly into a WP Media Folder folder. Is that possible?
Responses (7)
Accepted Answer Pending Moderation
Hi,

Thanks for contacting us here about this extension.
I have a custom file upload method that I wrote that uploads to the media library. When it uploads it goes to the root WP Media Folder structure. I want to add some code to add to my custom method, like a shortcode, that will allow me to put that file directly into a WP Media Folder folder. Is that possible?

I'm not sure which is your method? But you should try the function in the link below to customize.
https://codex.wordpress.org/Function_Reference/wp_set_object_terms

Hope it helps!
Cheers,
Accepted Answer Pending Moderation
Hi,

Thanks for your response, but it does not address my question. The upload method I am using is essentially irrelevant to the question. I am simply trying to place the uploaded file that gets uploaded through my custom script to be placed in WP Media Folder (plugin) directory, programatically, since it is not being uploaded through the main Media Folder interface within WordPress. I was hoping there is a shortcode or something like that, that would allow this to be possible.

Thanks!
Accepted Answer Pending Moderation
Hi,

Thanks for getting back to me with more information.
I was hoping there is a shortcode or something like that, that would allow this to be possible.

We use the function in the link above to add the images to folders in our plugin.
We now have not had a shortcode to fit your requirement.

Thanks a lot!
Cheers,
Accepted Answer Pending Moderation
Ok, thanks. Can you please provide an example of how one would use that function to do that?
Accepted Answer Pending Moderation
Hi,

Thanks for your response.
Can you please provide an example of how one would use that function to do that?

Yes, you can see the code below:

wp_set_object_terms( $file_id, $folder_id, 'wpmf-category' );


Hope it helps!
Cheers,
Accepted Answer Pending Moderation
Thanks. Can you please give me an example of how this would be used in conjunction with:
$uploaded = media_handle_upload('file_name', 0);

Thanks!!
Accepted Answer Pending Moderation
Hi,

Thanks for your message.
I'm sorry, this is a pre-sale forum, our ticket support system is a better area for your issue.
Please drop us a ticket (menu Support > Ticket support). Our developer in charge will take a look at that.

Cheers,
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.