I am working on a CPT in which I need to add some meta fields with which user can attach media. There is a condition to attach any one mime-type attachment to single post.
I created a two meta fields, 1) attachment type and 2) attachment. In Attachment Type user can select attachment types, like document, pdf, audio, video or image. And, in second field user can select media from media manager.
Now, I am facing issue that some time user is selecting different type of media than select attachment type. Like, he is selected the attachment type Video and attached the Image or Audio file with post.
How can I limit the Media Manager to specific mime-type? Like if user is selected the Audio then Media Manager will only display the audio files only. Or, if the user is selected the Image then display the images only in Media Manager.