I'm building my own WordPress plugin and I have a form where I put in some data. In addition, every entry has an image. Does anybody know how I can upload an image using the WordPress media selector?



Maybe this can help you out. This function handles the upload of the file and adds the attachment as WordPress media record. Don't forget to include dependencies if you're uploading from frontend.

  • Thanks, that worked pretty well! – Elly Mar 15 '19 at 21:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.