I’m writing a custom plugin and i would like to add the “Add Media” button.
I just need to upload media, not to retrieve any content/data from the uploaded file.
How can I add this button?
Thanks
I’m writing a custom plugin and i would like to add the “Add Media” button.
I just need to upload media, not to retrieve any content/data from the uploaded file.
How can I add this button?
Thanks
Comments are closed.
If you want to add a add media button to your admin panels:
You need to use wp_enqueue_media();
Then use this js:
Use this html:
Show thumbnail preview instead of number
Just as a tweak, I did this…
changed the number input to hidden.
added:
And then… above the hidden field.
That will make a thumbnail visible in the user end instead of a number 🙂