We would like users to be able to upload the post thumbnail when editing posts. How would this be done. I would imagine it would make use of the ajax functions of wordpress.
Any ideas,
Marvellous
We would like users to be able to upload the post thumbnail when editing posts. How would this be done. I would imagine it would make use of the ajax functions of wordpress.
Any ideas,
Marvellous
You must be logged in to post a comment.
Uploading files in ajax is a bit tricky because it is not possible to upload files using the browser’s XMLHttpRequest object so you need to use some kind of Ajax upload plugin and the easiest one would be the the JQuery Form Plugin which makes things much easier and it’s included in WordPress. So to use it you need to enqueue it:
on that page add your upload form and the JQuery to call the JQuery Form plugin for example:
you must update POSTID with the actual post ID.
then create the Ajax function to accept the file upload and update the post thumbnail
hope this helps