image block select modal > custom tab on the media modal with filtered media and allow select media


I want to do a plugin to mark some media files as Favorite and then the favorite media marked allow be displayed on the Select image modal that is showed when a user try to add or replace an image via the image block.

Now i have the meta_key field added, this is displayed on the details sidebar in the library media modal, the tab is displayed but not works for now the media favorite filter i see all the media files.

I have some problems to display the image media like on the Media Library tab and able to add the same behaviour to the media files to select and return the selected media to the image block.

I create a repository to this project, you can see the code on

image select media modal

  • Only the image 1 and 4 are marked as Favorite, but i got all the media files
  • Media files not be displayed with a good format, until i select Media Library tab and then select again the Favorite Media tab
  • The button is enabled because a file is selected on the Media Library tab

thanks for your help

juanbits 2 weeks 2023-05-21T14:27:30-05:00 0 Answers 0 views 0

Leave an answer