Thank you for the very useful plugin!
Could I suggest some improvement? It would be very nice to make some "shared" media, based, for example, on custom taxonomy. I mean some media files marked as shared could be visible at the media library for authors so they could use the same pictures as a featured images and so on.
I've been trying to add some changes at your plugin, but I gave up, I'm not a good programmer.
I confused here:
`$post_type = $query->get('post_type');