I have a very simple plugin in my wordpress. Now i have a function and i use add_submenu_page to add that function to my main function (plugin).
I want to add a upload form to upload images in this submenu_page . Images should be uploaded to wp-content/uploads.
So is there any simple form to do this? I want to do it with main wp functions but i don’t know how to do it.
Just needing a simple form to upload images in wp-content/uploads folder. How to do it ?
Thanks.
i did the following for a plugin i built. Dead simple!
Firsty you need to enqueue the wordpress media upload like so:
You then need to give the the input button an id of
upload_image_button
here’s an example:To display the file location in an input, use the following:
I hope this helps!