i would like to use the brand new wp's upload tool in a personnal theme options page. I found a lot of tutorials like : wp media uploader in plugins ...and it works very fine. But i'd like to filter the file type the end user can select ( and view ). I found many examples that use this way to filter by 'image' type ( param for wp.media object ) :
library:{ type:'image' }
You can see an example here. It works, when the uploader panel appear you only see pictures BUT :
- How can i filter other file types ( documents, zips, videos... ), i tried to replace 'image' by 'video' or 'document' it doesn't work
- When the end user choose to upload a file he can upload any file type instead of an image
How can i fixed that ? How to set a filter for one or more specific file types ?
Thanks a lot for help.