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 https://github.com/juanbits/jc-wp-favorite-media

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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.