Extending Media Manager to only show attachments by ID
I've searched numerous StackOverflow and Wordpress Awnsers questions, but
I couldn't find any solution that matches my situation or even remotely
points me in the right direction.
I have a custom media frame in my plugin where I have pre-selected certain
images out of a media library of about 3000 images. However, these
pre-selected images aren't sorted on top of the list by default, which
results in you browsing the list for hours to find your selected images.
In short I want these to be on top of the list. I have their ID's.
I found that in media-models.js where the code goes:
Query = media.model.Query = Attachments.extend({ ...
it handles the querying / sorting of the attachments that are displayed in
the media manager.
I've tried extending it like this in my main plugin javascript file
wp.media.model.Query = wp.media.model.Attachments.extend({ ...
which gave me no result and numerous other suggestions in question that
looked similar to my situation. Now I'm at the point where I'm out of
idea's of how to tackle this. Could someone point me in the right
direction?
No comments:
Post a Comment