Thanks for your update with the additional details. You are right that the example plugin I mentioned is not what you need.
You wrote “But today, when MLA is active my small function to filter ajax_query_attachments_args does not work any more. Independent of that, I did not found a solution to filter the list view of media library.”
MLA provides a number of filters and actions you might find useful. For example, in the “” section of the Settings/Media Library Assistant Documentation tab you can find filters similar to the ajax_query_attachments_args
filter you are using now. Have a look at these MLA hooks:
- mla_media_modal_query_initial_terms
- mla_media_modal_query_filtered_terms
- mla_media_modal_query_final_terms
The “MLA Media Modal Hooks Example” plugin will show you the details you need to implement these hooks.
You wrote “Independent of that, I did not found a solution to filter the list view of media library.” MLA does not make any changes to the “list” mode of the Media/Library admin submenu. Do you mean the Media/Assistant admin submenu? If so, there are hooks for this screen as well. You can explore them in the “Media/Assistant Submenu Actions and Filters (Hooks)” section of the Documentation tab.
I hope that helps. Please post an update if you have problems or further questions regarding the hooks MLA provides for filtering the “query attachments” results and the Media/Assistant admin submenu table.