
This is a simple plugin, built to fill a gap in the WP admin, which allows a user to see which posts have attachments ( and how many ) and to filter the list of media attachments shown to one specific post ( can be a post, page or any custom post type ).
There is only one configuration option – a filterable value for the post_types to show in the dropdown filter- here is an example usage:
\add_filter( 'q/filter_media_library_by_post/post_type', function(){ return [ 'post', 'custom_post_type' ]; });
The plugin is hosted on GitHub where it can be forked: https://github.com/qstudio/filter-media-library-by-post/
Screen grab of the added filter:

That’s it – happy coding 🙂
No comments on this article yet.