uploads – Media Library Filter & # 39; uploaded to this post & # 39; is missing in Gutenberg's picture insertion modal

ultimate goal: Return the input field for the selection menu so that a user can filter the results. "Uploaded to this post", "My", "Pictures", "Video", etc. when inserting a Gutenberg picture block; no gallery.

I'm trying to hijack the click on this button to open my new modal.

I have researched this for some time and see some possible solutions, but I do not understand how to implement them, or they are wrong.

Enter image description here

Enter image description here

Possible solutions:

  1. Replace A with B because A is the default UI flow when you click Add Image> Media Library. The MediaFrame.Select still has the modal frame input field of the Select menu.

A. var frame = new wp.media.view.MediaFrame.Select

For example, var frame = new wp.media.view.MediaFrame.Post

  1. Expand wp.media.view.MediaFrame.Select with the attribute & # 39; filterable & # 39 ;: & # 39; all & # 39; so that the input field for the selection menu is present when the modal is opened.
  2. Create a new custom good block that defaults to wp.media.view.MediaFrame.Post and leave the existing good image block in peace.

I tried the latest code to find a solution

I'm currently using a hook to load the JavaScript into my functions.php file.

Function add_my_filter_please () {

add_action (# admin_footer #, add_my_filter_please #);