I have made a plugin that uses the Media Library to allow users to upload files to a specific directory - using the upload_dir
filter.
I would like to know if there is a way (i.e. a filter) I can use to limit the media library to displaying only files contained within my custom folder?
If possible, I want the user to be able to choose only files that have been uploaded to the custom folder when interacting with the Media Library instantiated by my plugin.
pre_get_posts
andparse_query
with a temporary modification ofwp_upload_dir()
value could handle it... This Q could also be useful..